Design a distributed rate limiter with token bucket vs leaky bucket, sliding window, and BOE for QPS budgets.
Skip to solutionKEEP THE
mediumSystem Design
How would you design a rate limiter (token bucket vs leaky bucket)?
65 views
01
Understand the problem
rate-limitingtoken-bucketleaky-bucketsliding-windowredis
02
Attempt it yourself
Sketch your approach before reading the solution — that's what interviews test.
Nudge consolestandby
Stuck? Beam a request up — the console returns a conceptual nudge that guides your logic without spoiling the implementation.
03
Study the solution
Step 1: Use Cases, Constraints, Assumptions, Back-of-Envelope
Use cases
We'll scope to handle only the core flows that expose the bottlenecks; everything else is deferred.
- User calls API — each request checks limiter (user_id / IP / API key) against budget (e.g., 100/min), 429 if over.
- Service refi
Solution ready — 2 min read
Classified // press E to declassify
04
Join the discussion
Discussion (0)
Sign in to join the discussion.
No responses yet. Be the first to share what you think.
Transmission complete // awaiting log
KEEP THE
STREAK ALIVE.
Dossier 44 of 99 decoded in the System Design track. One more won't hurt.