Architecture & LLD

Rate Limiter

Architecture & LLD Preview

Rate Limiter

Limit requests per client with a pluggable policy — token bucket, leaky bucket, or sliding window.

The throttling algorithm is a Strategy — TokenBucketStrategy bounds bursts by capacity with continuous refill, SlidingWindowStrategy tracks an exact timestamp log with no boundary effect — both behind one RateLimitStrategy interface, returning a structured retry-after result.

Core Design Challenge

"Design a rate limiter. Why does the naive fixed-window counter let through 2x the intended limit at a window boundary?"

What You'll Learn:

  • Understanding eviction policies (LRU, LFU, FIFO)
  • Designing O(1) time complexity maps and list structures
  • Thread-safety, mutex locking, and concurrent read/write access
  • Managing memory boundaries and cache expiration policies
Premium

Unlock “Rate Limiter”

You are viewing the concept preview. Subscribe to unlock the interactive system design visualizer, complete step-by-step walkthroughs, and code editors.

  • Every problem simulation, step-by-step
  • Full LLD pattern walkthroughs + code editors
  • HLD deep dives & real system design breakdowns
$19one-time · lifetime

Founding price for early users — locked in for life.