InterviewStack.io LogoInterviewStack.io

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.

HardTechnical
68 practiced

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?

HardTechnical
110 practiced

A list endpoint causes heavy database load whenever clients page deep with a large offset, on a table with tens of millions of rows. Propose two different mitigations (for example a covering or composite index strategy, keyset pagination, or a denormalized read model) and, for each, describe what it costs you operationally and what changes for the client.

EasyTechnical
70 practiced

Implement a POST /tasks endpoint (Node.js with Express) that accepts JSON {title, dueDate}, validates that title is non-empty, persists the task to an in-memory store, and returns 201 Created with a Location header pointing at /tasks/{id} and the new task's id in the body. Handle malformed JSON and validation failures with an appropriate 4xx response.

EasyTechnical
73 practiced

Design the REST API contract for a time-series metrics endpoint that a dashboard will query: what parameters does it take (time range, granularity, filters), what does the response shape look like, and how does it fail gracefully when a client asks for too wide a range or too fine a granularity? Why do your choices make this API easy for dashboard developers to build against and hard for a single misbehaving client to overload?

HardTechnical
73 practiced

Implement conditional GET support (ETag and Last-Modified) for a resource that changes frequently and is large enough that recomputing a hash on every request would be expensive. Show the header exchange for both a cache hit (304 Not Modified) and a cache miss, and describe an efficient way to generate and validate the ETag that does not require re-serializing the whole resource just to check whether it changed.

Unlock Full Question Bank

Get access to all 39 RESTful API Design interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.