RESTful API Design Questions
Designing resource-oriented HTTP APIs following REST constraints: resource modeling, URI structure, correct use of HTTP methods, statelessness, and HATEOAS trade-offs. Covers naming conventions, collection vs. singleton resources, filtering/sorting/pagination, and choosing appropriate status codes. The default paradigm most interview questions in this category probe.
HTTP/2 and HTTP/3 change some of the assumptions REST API design grew up under: request multiplexing over one connection, header compression, and (in HTTP/3) a transport built on QUIC instead of TCP. What actually changes for a REST API's design and operations when you move from HTTP/1.1 to HTTP/2 or HTTP/3, for example does the old advice to avoid too many small requests still apply, and what should change in your load-balancing and CDN configuration?
A client reports getting inconsistent data back when they retried a POST that was supposed to be idempotent. Walk through how you would investigate: what you check first in the idempotency store, the database's unique constraints, and the request logs, and what root causes you would rule in or out (a race condition between two concurrent requests with the same key, a missing unique constraint, or a malformed or reused idempotency key). What change would you make afterward to prevent a recurrence?
Design the REST endpoints for a Book resource that also has nested Reviews belonging to it: list, get one, create, update, and delete a book, plus list and add reviews for a book. For each endpoint give the HTTP method, the canonical path, the expected request body where relevant, and the success status code. How do you keep the response shape for the list endpoint from triggering an N+1 query when reviews are included, and how does pagination interact with the nested collection?
Design a REST API for a long-running bulk job (for example a bulk data export) that must support submit, status polling, pause, resume, and cancel, plus resuming correctly after a failure. Define the job's state machine and which transitions are valid from which states, ensure operations stay idempotent under retries, and describe what the client-visible progress and error model looks like.
Explain the architectural difference between a RESTful API and an RPC-style API: how URLs are used, whether the HTTP verb carries meaning, statelessness, resource orientation, and what each style implies for caching and for how tightly the client and server are coupled. Give one situation where you would prefer RPC over REST in a backend service.
Unlock Full Question Bank
Get access to all 33 RESTful API Design interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.