Bird
0
0

In the token bucket algorithm, what happens when the bucket is full and new tokens are added?

easy📝 Conceptual Q2 of 15
Rest API - Rate Limiting and Throttling

In the token bucket algorithm, what happens when the bucket is full and new tokens are added?

AThe refill rate doubles
BNew tokens are discarded
COld tokens are removed to add new ones
DThe bucket size increases automatically
Step-by-Step Solution
Solution:
  1. Step 1: Understand bucket capacity in token bucket algorithm

    The bucket has a maximum capacity for tokens.
  2. Step 2: What happens when bucket is full?

    If the bucket is full, any new tokens generated are discarded to avoid overflow.
  3. Final Answer:

    New tokens are discarded -> Option B
  4. Quick Check:

    Full bucket discards new tokens [OK]
Quick Trick: Tokens don't overflow bucket capacity; extras are dropped [OK]
Common Mistakes:
  • Assuming bucket size grows
  • Replacing old tokens
  • Changing refill rate automatically

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes