InterviewLegend

Design a Rate Limiter

Signature problem
Alex Chen45 min readAdded 138 real interview reports

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.

The Amazon angle
Leadership Principle questions often take the first 15 to 30 minutes of the hour, so the design gets 30 to 45 minutes. The low-level slot means writing an algorithm; the high-level slot means many instances sharing one limit through Redis. The same prompt can go either way, so prepare both halves.

AmazonPremium lesson · System design round

The Amazon design, worked end to end.

  1. The API and data modelSystem design · Signature problem
  2. The design, drawn out2 diagrams
  3. 6 deep divesWith the tradeoffs
Get the Amazon questions

$49 a year · all 107 companies · instant access

138 Amazon interview reports · guide updated

Amazon interview guide

Know what Amazon asks before you walk in.

19 coding · 8 system design · 36 behavioral questions

Get Premium$49 a year · Instant access
Or start freeNo card.

Get their questions first.

Had your Amazon interview?How we research

InterviewLegend is independent and not affiliated with or endorsed by any company it covers.