Design a Rate Limiter
A rate limiter counts how many requests each client has sent recently and turns away the ones over its limit, usually with a 429 Too Many Requests response. It protects the services behind an API from a client stuck in a retry loop or a scraper pulling everything it can. It also makes each customer's plan mean something. At Amazon this is a common system design interview prompt at SDE II, and it shows up in two different rounds. In the high-level design round it's the distributed version: hundreds of API servers, one shared count per client, and millions of requests a second. In the hiring-manager or low-level design round it's closer to code. You compare the algorithms, pick one and write it so it holds up under threads. This lesson works the distributed design and writes the core in Java, so it covers either slot.
AmazonPremium lesson · System design round
The Amazon design, worked end to end.
- The API and data modelSystem design · Signature problem
- The design, drawn out2 diagrams
- 6 deep divesWith the tradeoffs
$49 a year · all 107 companies · instant access
138 Amazon interview reports · guide updated
Amazon interview guideKnow what Amazon asks before you walk in.
19 coding · 8 system design · 36 behavioral questions
Get their questions first.
InterviewLegend is independent and not affiliated with or endorsed by any company it covers.