Back to All 30 System Design Questions
LLDMediumQuestion 30 of 30
Design a Pluggable Rate Limiting Algorithm Library (Token / Leaky Bucket / Sliding Window)
Design and implement a thread-safe, pluggable rate limiting library supporting Token Bucket, Leaky Bucket, and Sliding Window Counter algorithms with microsecond-level synchronization.
Asked by:StripeCloudflareRazorpay
#Low Level Design#Concurrency#Strategy Pattern#Rate Limiting#Token Bucket
Object-Oriented Class Hierarchy
Compiling architecture diagram...
Pluggable Rate Limiting Library
Implements the Strategy pattern across Token Bucket and Sliding Window algorithms, calculating token replenishment dynamically via timestamp deltas upon request arrival to avoid idle timer thread overhead.