Practice & Assessment
Test your understanding of HTTP Foundations and REST Principles
Multiple Choice Questions
6Which HTTP method should you use to update only the email field of an existing user record?
An API returns status 200 with body `{ success: false, error: 'Not found' }` for a missing resource. What is wrong?
Which REST constraint requires that the server store no session state between requests?
You delete a resource at /posts/5 and it succeeds. Which status code is most appropriate if the response body is empty?
Which of the following URL designs correctly follows REST naming conventions?
A client sends a valid JSON request body but the email field fails format validation. What status code should the server return?
Coding Challenges
1Design a URL scheme for a blog platform
Design the complete REST URL structure for a blog platform with Users, Posts, Comments, and Tags resources. List every endpoint (method + URL) needed for full CRUD on each resource. Include at least one nested resource endpoint and two query-parameter filtering examples. Output as a plain text table with columns: Method, URL, Description. No coding required โ this is a design exercise. Time estimate: 20 minutes.
Mini Project
HTTP Inspector CLI
Build a Node.js CLI tool that accepts a URL as a command-line argument, makes an HTTP GET request to it, and prints: the status code with its meaning (e.g. '200 OK โ Success'), all response headers formatted as key: value, the response body truncated to 500 characters, and whether the response is cacheable based on Cache-Control or Expires headers. Use only the built-in https module โ no external libraries. The tool must handle errors (DNS failure, timeout, non-2xx) and print a descriptive message for each. Run with: node inspector.js https://jsonplaceholder.typicode.com/posts/1
