InterviewStack.io LogoInterviewStack.io

RESTful API Design and HTTP Fundamentals Questions

Understanding REST architectural principles including resource-based URLs, proper HTTP methods (GET for safe retrieval, POST for creation, PUT for updates, DELETE for deletion), appropriate status codes (200 OK, 201 Created, 400 Bad Request, 404 Not Found, 500 Internal Server Error), and stateless communication patterns. Ability to design simple API endpoints following REST conventions.

EasyTechnical
72 practiced
Given the following scenarios, pick the most appropriate HTTP status code and briefly justify your choice:1) Successfully created a new user resource.2) Client submits malformed JSON.3) Client requests a resource that doesn't exist.4) Server fails during processing due to an unexpected exception.5) A request is valid but the client is not authenticated.State the numeric code and short justification for each.
HardTechnical
61 practiced
Concurrent updates to the same resource can cause race conditions. Describe optimistic concurrency control using versioning (e.g., ETag or version field) and show how a RESTful update flow using If-Match would work. Also discuss pessimistic locking alternatives and when each approach is appropriate.
EasyTechnical
81 practiced
When should filtering, sorting and pagination parameters be passed as query parameters vs included in the request body? Design an example GET endpoint for searching orders with filters (status, date range), sorting, and pagination, and explain why query parameters are preferred in this case.
EasyTechnical
79 practiced
Compare URI path versioning (e.g., /v1/users), header-based versioning (Accept: application/vnd.myapp.v1+json), and query-parameter versioning (?version=1). For a public B2B API with many long-lived clients, which approach would you recommend and why? Consider discoverability, caching, and client complexity.
EasyTechnical
60 practiced
Why is rate limiting important for public APIs? Describe three common rate-limiting strategies (e.g., fixed window, sliding window, token bucket) and give one example scenario where each strategy is preferred. Also explain how clients should be informed about their rate limits via HTTP headers.

Unlock Full Question Bank

Get access to hundreds of RESTful API Design and HTTP Fundamentals interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.