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.

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
68 practiced

For each of GET, POST, PUT, PATCH, DELETE, HEAD, and OPTIONS, state whether it is safe, whether it is idempotent, and whether it is cacheable, then give a short example endpoint where using the wrong method caused a real bug (for instance, a client retry duplicating a purchase, or a caching layer serving a stale response for a method it should not have cached).

EasyTechnical
61 practiced

Write the JSON body a server should return for a failed POST /orders call, using the Problem Details for HTTP APIs format. Include type, title, status, detail, and instance from the standard, plus a machine-readable error_code and a correlation_id you add on top of it, and briefly say what each field is for.

HardTechnical
117 practiced

Compare four ways to expose a long-running operation to a client: a synchronous call with a long timeout, an asynchronous job endpoint the client polls, a webhook callback on completion, and a push mechanism like Server-Sent Events or WebSockets. For each, describe the API contract for starting the operation and getting the result, and the trade-off in scalability, reliability, and how much complexity it pushes onto the client.

MediumTechnical
56 practiced

Your organization wants a single standard shape for API error responses instead of every team inventing its own. Explain what the Problem Details for HTTP APIs standard (RFC 7807) specifies as required versus optional fields, and what you would add beyond the standard (for example a machine-readable error code, a correlation id, and a retryable flag) to make it genuinely useful for SDK authors and partner integrators.

Unlock Full Question Bank

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

Sign in to Continue

Join thousands of developers preparing for their dream job.