Design a Distributed Rate Limiter
Last updated: June 17, 2026
Quick Overview
Design a rate limiting service for an API gateway. Compare token bucket, leaky bucket, and sliding window algorithms. Cover distributed coordination across data centers and handling edge cases like clock skew.
Google
System Design
Software Engineer
Software Engineer
System Design Round
System Design
Medium
161
0
268 solved
Design a rate limiting service for an API gateway. Compare token bucket, leaky bucket, and sliding window algorithms. Cover distributed coordination across data centers and handling edge cases like clock skew.
How to Approach This
- Start by clarifying functional and non-functional requirements with the interviewer.
- Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
- Draw a high-level architecture first, then deep dive into 1-2 critical components.
- Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
- Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
Requirements
- Functional Requirements:
- Implement a distributed rate limiter using a token bucket algorithm.
- Support multi-tenancy to handle different rate limits for various users.
- Provide APIs to...
Capacity Estimation
Assuming Perplexity has 10,000 active users querying the LLM API:
- Each user makes an average of 10 requests per minute, leading to a total of:
- Total requests per minute = 10,000 users * 10 reque...
Submit Your Answer
Markdown supported