Design labs · 5 questions

Design a Distributed Rate Limiter

"Design a distributed rate-limiting service that protects our public API gateway from abuse, handling up to 500,000 requests per second with sub-2ms latency overhead."

Rate limiting is the first line of defense in distributed infrastructure. A flawed design either adds crippling latency to every user request or allows coordinated traffic spikes to take down primary databases.

Work through the core architectural trade-offs: algorithm selection, centralized vs local storage, race conditions under concurrent requests, and fail-open vs fail-closed policies.

Step 1 of 5

Requirements gathering

Which requirements and operational constraints define the rate limiter design?

This scenario leans on Rate Limiting, Caching and Consistent Hashing. Reading one first is a recommendation, never a requirement — and doing the lab cold then reading is a perfectly good order.