Recall & Review
beginner
What is the main purpose of rate limiting in system design?
Rate limiting controls how many requests a user or system can make in a given time to prevent overload and ensure fair resource use.
Click to reveal answer
beginner
Describe the Token Bucket algorithm in simple terms.
Token Bucket allows requests if there are tokens available. Tokens are added at a steady rate. Each request uses one token. If no tokens, request is denied or delayed.
Click to reveal answer
beginner
How does the Leaky Bucket algorithm control request flow?
Leaky Bucket processes requests at a fixed rate. Excess requests wait in a queue. If the queue is full, new requests are dropped.
Click to reveal answer
intermediate
What is a key difference between Token Bucket and Leaky Bucket algorithms?
Token Bucket allows bursts of requests up to token count, while Leaky Bucket smooths out bursts by processing at a constant rate.
Click to reveal answer
intermediate
Why might a system choose Token Bucket over Leaky Bucket for rate limiting?
Token Bucket is better for systems that allow short bursts of traffic, giving flexibility while still controlling average rate.
Click to reveal answer
Which rate limiting algorithm allows bursts of requests up to a token limit?
✗ Incorrect
Token Bucket allows bursts by accumulating tokens that can be spent quickly.
In the Leaky Bucket algorithm, what happens when the queue is full and a new request arrives?
✗ Incorrect
New requests are dropped if the queue is full to prevent overload.
Which algorithm processes requests at a fixed, steady rate?
✗ Incorrect
Leaky Bucket processes requests at a constant rate, smoothing bursts.
What does a token represent in the Token Bucket algorithm?
✗ Incorrect
Each token allows one request to be processed.
Why is rate limiting important in distributed systems?
✗ Incorrect
Rate limiting protects systems from overload and abuse.
Explain how the Token Bucket algorithm works and when it is useful.
Think of tokens as tickets to make requests.
You got /4 concepts.
Describe the Leaky Bucket algorithm and how it differs from Token Bucket.
Imagine water leaking from a bucket at a steady rate.
You got /5 concepts.