System Design · Middle · Question 38 of 75
How does the token bucket rate limiting algorithm work?
- ✓Correct answer: The bucket refills with tokens at a constant rate; each request spends one
- 2Each user gets a fixed number of requests forever
- 3Requests are processed strictly one at a time in queue order
Explanation
Bucket capacity sets the allowed burst, the refill rate sets the average limit. When tokens run out, the server responds with 429. Alternatives: fixed/sliding window, leaky bucket.