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.

EasyTechnical
65 practiced

Critique these endpoints and redesign them to follow resource-based REST conventions: GET /getUser?id=123, POST /user/create, GET /v1/get-all-books, and /accounts/123/transactions?start=.... For each, say specifically what is wrong (a verb in the path, inconsistent pluralization, an ambiguous or missing resource identifier) and show your redesigned path and method.

EasyTechnical
66 practiced

For a public partner API, an internal high-throughput service mesh, and a mobile client on unreliable networks, would you reach for REST, GraphQL, or gRPC? Compare the three on caching, client flexibility, network overhead, versioning, and developer ergonomics, and justify a different choice (or the same one) for each of the three scenarios.

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?

Unlock Full Question Bank

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

Sign in to Continue

Join thousands of developers preparing for their dream job.