CS FundamentalsVery hardProduct-company system-design interview

A token-bucket rate limiter holds up to 10 tokens and refills 2 tokens per second; it starts full. A client fires requests as fast as possible. How many requests are accepted in the first 3 seconds?

  1. A. 6
  2. B. 10
  3. C. 16
  4. D. 30

Correct answer: C. 16

The full bucket lets a burst of 10 through at once, then 2 tokens per second add 6 more over 3 seconds: 16. Token buckets allow bursts up to capacity while enforcing the long-run rate.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic