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

  1. What rate limiting is for, and what to key it on
  2. Fixed window counter
  3. Sliding window log
  4. Sliding window counter (weighted)
  5. Token bucket (with Redis Lua)
  6. Leaky bucket (queue and meter) and GCRA
  7. Algorithm comparison
  8. Distributed rate limiting: centralized vs local, and race conditions
  9. Response contract: 429, Retry-After and RateLimit headers
  10. Where to enforce: edge, gateway, service
  11. When the limiter itself fails: fail-open vs fail-closed
  12. Scenario playbook

Previous: Redundancy, Disaster Recovery & Multi-Region · Next: Production Judgment: Avoiding Fallback, Constant Work, Queue Backlogs, Metastable Failures & Rollback-Safe Deploys