Design a rate limiter for an API gateway handling 100,000 requests per second. The limiter should support per-user and per-endpoint limits (e.g., 100 requests per minute per user). It must be distributed across multiple gateway instances.
Cover: algorithm choice, storage, accuracy vs. performance tradeoffs, and handling edge cases like burst traffic.
How to approach it
- Hint 1
Compare fixed window, sliding window log, sliding window counter, and token bucket algorithms.
- Hint 2
Redis is commonly used for distributed counters with atomic operations and TTL.
- Hint 3
Think about what happens at window boundaries -- the 'boundary burst' problem.
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.