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.

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?

MediumTechnical
83 practiced

Explain how Cache-Control, ETag, Last-Modified, and Vary work together to let a client avoid re-downloading a resource it already has. Walk through the exact sequence of headers exchanged on a cache hit versus a cache miss for a GET request, and say when you would reach for stale-while-revalidate instead of a hard max-age.

HardSystem Design
82 practiced

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.

EasyTechnical
75 practiced

Compare URI-path versioning (/v1/resource), header-based versioning (a custom Accept media type), and query-parameter versioning (?version=1) for exposing multiple API versions at the same time. For a public B2B API with many long-lived client integrations, which mechanism would you default to, and how does your choice interact with caching, discoverability, and how much complexity it pushes onto the client?

EasyTechnical
70 practiced

A single-page app served from app.example.com needs to call an API at api.example.com. Explain why the browser enforces the same-origin policy in the first place, when it will send a preflight OPTIONS request instead of the real request directly, and which response headers your API must return to allow the SPA's GET and POST calls with a JSON body, including what changes if the request needs to carry credentials.

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.