Script Valley
REST API Development: Beginner to Production
HTTP Foundations and REST Principles/Assessment

Practice & Assessment

Test your understanding of HTTP Foundations and REST Principles

Multiple Choice Questions

6
1

Which HTTP method should you use to update only the email field of an existing user record?

2

An API returns status 200 with body `{ success: false, error: 'Not found' }` for a missing resource. What is wrong?

3

Which REST constraint requires that the server store no session state between requests?

4

You delete a resource at /posts/5 and it succeeds. Which status code is most appropriate if the response body is empty?

5

Which of the following URL designs correctly follows REST naming conventions?

6

A client sends a valid JSON request body but the email field fails format validation. What status code should the server return?

Coding Challenges

1
1

Design 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.

Easy

Mini Project

1

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

Easy