Rate Limiting & Throttling
Fixed window, sliding log, sliding window counter, token bucket and leaky bucket — implemented, compared and distributed across a fleet, with the headers, placement and fail-open/fail-closed decisions interviewers probe.
About 85 minutes · 15 exam questions · 8 interview questions · 2 code labs
What you will learn
- What rate limiting is for, and what to key it on
- Fixed window counter
- Sliding window log
- Sliding window counter (weighted)
- Token bucket (with Redis Lua)
- Leaky bucket (queue and meter) and GCRA
- Algorithm comparison
- Distributed rate limiting: centralized vs local, and race conditions
- Response contract: 429, Retry-After and RateLimit headers
- Where to enforce: edge, gateway, service
- When the limiter itself fails: fail-open vs fail-closed
- Scenario playbook
Previous: Redundancy, Disaster Recovery & Multi-Region · Next: Production Judgment: Avoiding Fallback, Constant Work, Queue Backlogs, Metastable Failures & Rollback-Safe Deploys