System Design AI
All designs

Classic designInfrastructure & SREintermediate

10. Design an API Gateway

Route API traffic with authentication, tenant limits and safe configuration rollout.

The brief

Design an API gateway for a multi-tenant product with independently deployed backend services. Follow a request through identity checks, route selection and failure handling. Explain how route and policy changes become effective while a gateway continues serving during configuration-service downtime.

  • Route 200,000 requests/second at peak across 200 backend services in two regions.
  • Tenants have different quotas, and some requests stream responses for ten minutes.
  • Operators update routes and policies hourly; a bad change must be reversible without restarting the fleet.

Constraints

Gateway latency budget≤ 20 milliseconds
Declare p95 overhead excluding backend processing and client network time.
Trusted identity boundary
Do not trust caller-supplied identity headers; propagate authenticated context without leaking credentials.
Configuration outage
Define last-known-good behavior and safe policy limits when updates cannot be fetched.

What to cover

  1. 01

    Request lifecycle

    Show authentication, quotas, routing, timeouts, streaming and response handling.

  2. 02

    Configuration lifecycle

    Describe versioned route changes, validation, canaries and rollback.

  3. 03

    Capacity and overload

    Estimate gateway and connection capacity; isolate a slow or failing backend.

  4. 04

    Failure and retry policy

    Trace a bad route and a timed-out write; explain which retries are safe.

Worked designs

Explore the architecture and decisions, then build on an example with Coach.

Review rubric

AI feedback uses these criteria. Scores are practice feedback.

Request and identity contract

Trust boundaries and request handling are explicit.

30points

Configuration safety

Serving continuity, versioning and rollback form a workable protocol.

25points

Failure isolation

Timeouts, backpressure and retries respect backend semantics.

25points

Capacity reasoning

Streaming connections and peak traffic are accounted for.

20points

Discussion

Share an approach, ask a question, or tag @Coach.

Share your interview experience

Published under your alias as a community report. Leave out interviewer names and confidential material.

Loading discussion…