API design interview questions: REST, HTTP, GraphQL and gRPC
Resources and methods, status codes, idempotency keys, ETags, pagination, versioning, errors, rate limits, webhooks and when to pick GraphQL or gRPC.
– interview-ready · 22 questions in this topic
– of 22 tried
Saved on this device. Interview-ready means you got it right on two different days. Guesses and hints count for less.
Questions
- Designing REST resourcesPick the fix
- Safe and idempotent HTTP methodsPredict
- Choosing HTTP status codesPick the fix
- Idempotency keys for POSTFill the blank
- ETags and conditional requestsPredict
- Paginating API responsesPredict
- Versioning an APIPick the fix
- Which API changes are breakingPick the fix
- A consistent error formatPredict
- Rate limiting with a token bucketPredict
- 429, Retry-After and rate-limit headersPick the fix
- When GraphQL fits and what it costsPick the fix
- gRPC vs RESTPick the fix
- Designing reliable webhooksPredict
- Long-running operations: 202 and pollingOrder the steps
- CORS: what it protects and how to configure itPick the fix
- JSON pitfalls: money, big ids and datesPredict
- PATCH: merge patch vs JSON PatchPredict
- Uploading large filesOrder the steps
- Polling, SSE and WebSocketsPick the fix
- Batch and bulk endpointsPredict
- What an API gateway doesPick the fix
Practise this topic
Flashcards · 28
Flip, then say if you knew it. Needs JavaScript; every answer is also on its question page.
Quick quiz · 22 questions
One exercise per question, checked as you go. Needs JavaScript.
Mock interview · 4 sets
Timed, out loud, then tick what you covered. Needs JavaScript.
Quick facts
Recall the answer first, then tap Show to check.
Idempotent methods
GET, HEAD, PUT, DELETE and OPTIONS are idempotent in HTTP semantics; POST isn't, and PATCH isn't guaranteed.
RFC 9457
Problem Details for HTTP APIs (2023), replacing RFC 7807: type, title, status, detail, instance.
Largest safe JavaScript integer
2^53 − 1 = 9,007,199,254,740,991. Send bigger ids as strings.
412 vs 428
412 Precondition Failed: If-Match didn't match. 428 Precondition Required: the server insists on a condition.
JSON Merge Patch
RFC 7396: null deletes a field and arrays are replaced wholesale.
S3 multipart limits
Parts of 5 MiB to 5 GiB (the last can be smaller), up to 10,000 parts per upload.
Printable cheat sheet · Review your weak spots in this topic
Share your progress
Sources: Topic outline informed by System Design Primer by Donne Martin and the Zalando RESTful API Guidelines, both licensed under CC BY 4.0. Every question and answer is written by Best Latest Apps. Credits and license