API Interview Prep
5 min read Quiz at the end
API interview: REST vs GraphQL vs gRPC, idempotency, status codes, JWT, OAuth2, rate limiting, pagination.
API Interview Topics
- REST vs GraphQL vs gRPC — REST: simple/universal; GraphQL: flexible queries; gRPC: binary/fast/streaming
- Idempotency — GET/PUT/DELETE idempotent; POST not; idempotency keys prevent duplicate POSTs
- Status codes — 201 created, 204 no content, 400 bad request, 401 unauth, 403 forbidden, 404 not found, 429 rate limited
- JWT vs sessions — JWT is stateless (no server storage); sessions require server-side state
- OAuth 2.0 — authorization code for users, client credentials for services
- Rate limiting — 429 + Retry-After; per-user and global; token bucket for burst
- Cursor pagination — consistent across inserts/deletes unlike offset pagination
- Webhooks vs polling — webhooks push events; polling burns requests
- CORS — browser security; configure allowed origins precisely
Topic Quiz · 1 questions
Test your understanding before moving on
1. What is the key difference between REST and gRPC?
💡 gRPC uses binary serialisation (Protobuf) making it significantly faster than REST with JSON.