advanced practice · system design prompt

Distributed rate limiter

Design a rate limiter for an API: 1000 req/min per user, deployed across 10 app servers. Compare token bucket vs sliding window, and where the counter lives.

The mechanism

Distributed systems multiply the ways things can fail. Every network call can be slow, retried, lost, or duplicated. Design for partial failure first — timeouts, idempotency, bounded queues — and worry about speed second.

Study Distributed Infra

Expected evidence

Algorithm choice + storage backend (Redis?) + how you handle a Redis outage.

Try this drill in the practice workspace →

Hints when you need them
  • Per-instance counters undercount; central counters add latency.
  • Approximation (e.g. sketch) can be acceptable.

Check the sources

Browse all practice briefs