Back to all articles
System Design November 20, 2025Updated 13 min read

API Design Interview Questions: REST, GraphQL, and Beyond

In almost every backend or full-stack interview, you'll be asked to design an API. Many candidates simply write out a few CRUD endpoints and stop. This guarantees a rejection. Senior engineers understand that API design is about contracts, backward compatibility, security, and scalability.

Modern cloud infrastructure and API servers in a blue-lit data center

API Design Fundamentals

Before discussing specific protocols, understand that every API design decision involves trade-offs. The interviewer wants to see that you can articulate these trade-offs, not just pick the "right" answer.

The 5 Pillars of Production API Design

ConsistencyPredictable naming, response shapes
VersioningBackward compatibility strategy
SecurityAuthN, AuthZ, rate limiting
PerformanceCaching, pagination, compression
DocumentationOpenAPI specs, examples

REST: When and Why

REST remains the dominant API paradigm for public-facing APIs. But interviewers want to see you go beyond the basics. Discuss Richardson Maturity Model levels, HATEOAS, and content negotiation.

LevelNameDescriptionExample
0The Swamp of POXSingle endpoint, RPC-stylePOST /api with action in body
1ResourcesIndividual URIs per resource/users, /orders
2HTTP VerbsProper use of GET, POST, PUT, DELETEGET /users/123
3HATEOASHypermedia links in responsesLinks to related resources
"A REST API should be entered with no prior knowledge beyond the initial URI (bookmark) and set of standardized media types that are appropriate for the intended audience."
- Roy Fielding, who defined REST, in REST APIs must be hypertext-driven (2008)
Diagrams pinned to a wall and connected during a design session

GraphQL: The Trade-offs Nobody Discusses

GraphQL solves real problems (over-fetching, under-fetching), but introduces its own challenges. In an interview, discussing both sides shows engineering maturity:

✓ GraphQL Strengths

  • • Client controls exact data shape
  • • Single endpoint, fewer round-trips
  • • Strong typing with schema validation
  • • Built-in introspection for tooling

✗ GraphQL Challenges

  • • N+1 query problem without DataLoader
  • • Caching is significantly harder
  • • Rate limiting per query is complex
  • • File uploads require workarounds

gRPC: The Microservices Choice

gRPC excels for internal service-to-service communication where performance matters. Its binary Protocol Buffers format is typically smaller on the wire and faster to parse than JSON, and the schema doubles as a contract between services. That is why it is common between internal microservices at large companies.

  • → Unary RPC: Simple request-response (equivalent to REST)
  • → Server streaming: Client sends one request, server streams multiple responses
  • → Client streaming: Client streams multiple requests, server sends one response
  • → Bidirectional streaming: Both sides stream simultaneously (real-time chat, gaming)
Laptop displaying API documentation and code in a professional development environment

API Versioning Strategies

StrategyExampleProsCons
URL Path/v1/usersSimple, visibleBreaks REST principles
HeaderAccept: v=2Clean URLsHidden, harder to test
Query Param?version=2Easy to switchPollutes query string

Rate Limiting Architecture

Every production API needs rate limiting. In an interview, you should be able to discuss two key algorithms:

Token Bucket

Tokens are added at a fixed rate. Each request consumes a token. Allows bursting up to the bucket capacity. Ideal for APIs that need to allow short bursts. Used by AWS API Gateway.

Sliding Window

Counts requests in a rolling time window. No bursting allowed. More predictable throughput. Higher memory usage. Used by Stripe and Shopify for payment APIs.

Idempotency: The Senior Engineer Signal

If there's one concept that separates juniors from seniors in an API interview, it's idempotency. When a client sends a POST to charge a credit card and the network drops before the response, the client retries. Without idempotency, you double-charge the user.

Stripe's own API accepts an Idempotency-Key header on POST requests for exactly this reason: a client can retry a payment after a timeout without charging the customer twice (Stripe API docs).

Backend engineer interview prep builds an idempotent transfer endpoint step by step: what the server stores for each key, when it checks it, and what a retry gets back.

Server infrastructure with organized cabling at a major tech company data centerDeveloper coding API endpoints with green syntax highlighting on laptop

Practice API Design Interviews

Devana's system design mock interviews let you practice explaining protocol choices, versioning and failure handling out loud, with an AI interviewer that asks follow-up questions.