Question bankPricingSign in

Design an API Gateway

API InfrastructureEasy1:30

Design an API gateway that serves as the single entry point for a microservices-based e-commerce platform. The gateway handles authentication, request routing, rate limiting, response transformation, and API versioning. It fronts 20 backend microservices (product catalog, cart, orders, payments, etc.) and handles 10,000 requests per second.

In your 90-second answer, cover: - Core responsibilities of the gateway and why they belong here vs. in individual services - Request routing: how incoming requests are mapped to backend services - Authentication and authorization at the gateway layer - How you handle API versioning (supporting v1 and v2 simultaneously)

Constraints: the gateway must add less than 10ms of latency to each request. It must not become a single point of failure.

How to approach it

  • Hint 1

    The gateway is a reverse proxy with intelligence. Think about what cross-cutting concerns should be centralized (auth, rate limiting, logging) vs. what should stay in services (business logic).

  • Hint 2

    For routing, the gateway maintains a route table mapping URL patterns to backend services. This can be static (config file) or dynamic (service registry).

  • Hint 3

    To avoid being a single point of failure, deploy multiple gateway instances behind a load balancer. But then consider: how does shared state (rate limit counters, session data) work across instances?

Ready to answer it out loud?

Record your answer in 1:30 and Preptile scores it 1–10 with specifics — what landed, what you skipped, and what to say next time.

Practising needs an invite code. Join the waitlist and we’ll send you one.