Mock Interviewer
Ask Coach
Tap a question to start, or type your own below.
Rate Limiter System Design Interview
Visual Problem Diagram

Scenario
Before each API request runs, decide: is this user still under their limit? If yes, let them through. If no, stop them. Hard parts: many servers must agree on the same count, the check must stay fast, and you must say what happens if the counter store is briefly down (stop everyone, or let them through).
Design a rate limiter that sits on the API gateway path and decides, per request, whether a client may proceed. The hard part is not the definition—it is shared counters across many gateways, a fast check, and a clear fail-open vs fail-closed policy when the store blips.
In production, rate limiters sit in front of APIs (often at the gateway) and decide per request whether to allow or reject based on the client’s usage so far. You need to support many clients, many gateway nodes, and strict latency and availability requirements. The system should support configurable limits per client (e.g. by user ID, IP, or API key), per endpoint, and per tier (e.g. free vs premium). You should be able to explain one counting style, how state is shared across nodes, and what happens when the rate limiter or its store fails.
Constraints
Limit requests per client per time window, more than one counting style, per-user and per-tier limits, whitelisting, rate limit headers in response
Low latency (under 1 ms overhead), high request rates, precise enough limits, works across multiple servers
(typical whiteboard): 10M requests/s, 100M unique clients, ~100 bytes per client (~10 GB total), 1-minute window
Stages ahead
Log in to start practicing
Preview the problem below. Sign in to start your timed session, save progress, and use the AI coach.