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?
- A. 6
- B. 10
- C. 16
- 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.
Practise more Software Engineering, Git and Cloud Basics questionsSoftware Engineering, Git and Cloud Basics: notes and key points
More Software Engineering, Git and Cloud Basics questions
- main has A-B-C. feature1 branched from C with commits D-E, and feature2 branched from E with commits F-G. feature1 is abandoned, but…
- A developer edits a tracked file app.py, creates a new file util.py, and runs git commit -a -m "update". What is committed?
- A CI job runs git clone --depth 1 on a large repository. Which statement is correct?
- Assertion (A): Raising average server CPU utilisation from 50% to 95% to save cost usually makes response times much worse. Reason (R): In…
- In 30 days a service had 4 incidents with total downtime of 6 hours. What are its mean time between failures (uptime-based) and its…
- A team distinguishes elasticity from scalability. Which statement is correct?