Interview Q&A · questions with model answers
API Design Interview Questions
Part of the study plan for: Backend Engineer · Full Stack Engineer · Native AI Engineer · Forward Deployed Engineer (FDE) · QA Engineer / SDET · Tech Lead
Ordered by how often they're asked. Most-asked answers are free to read in full; members see every answer and can rate their confidence on each.
-
Most asked Which HTTP methods are safe and idempotent, and why does it matter?
Safe methods (GET, HEAD, OPTIONS) don't change state; idempotent methods (GET, HEAD, PUT, DELETE, OPTIONS) have the same effect whether called once or many times. POST and PATCH are not idempotent…
-
Most asked Which HTTP status codes should an API use, and when?
200 OK, 201 Created (with Location), 202 Accepted (async processing), 204 No Content; 400 Bad Request (malformed), 401 Unauthenticated, 403 Forbidden, 404 Not Found, 409 Conflict, 412 Precondition…
-
Most asked Compare offset pagination and cursor (keyset) pagination.
Offset pagination (?page=3&size=20 → OFFSET 40 LIMIT 20) is simple and allows jumping to pages, but gets slow on deep pages and can skip or duplicate items when data changes. Cursor pagination…
-
Most asked When would you choose GraphQL over REST, or gRPC over both?
GraphQL suits client-driven data needs (many screens/clients needing different shapes, avoiding over/under-fetching) with a typed schema; REST suits resource-oriented public APIs with HTTP caching…
-
How do you design bulk or batch endpoints?
Accept an array of items with a size limit, process them transactionally or individually, and return per-item results (status, ID or error) so clients can retry only failures; for large batches use…
-
PUT vs PATCH: how do you implement updates?
PUT replaces the whole resource with the provided representation (idempotent); PATCH applies a partial update, using JSON Merge Patch (send only changed fields; null deletes) or JSON Patch (a list…
-
What should a health or status endpoint return?
A cheap liveness endpoint returning 200, a readiness endpoint that checks critical dependencies with timeouts, and optionally a detailed internal status (versions, dependency states) protected from…