← Quiz: Design a Rate Limiter: all 15 questions
Quiz: Design a Rate Limiter · Question 12 of 15
What does this print? (code)
What does this print?
previous, current = 40, 12
fraction_into_window = 0.3
estimate = current + (1 - fraction_into_window) * previous
print(round(estimate))
- A.52
- B.24
- C.40
- D.12
Answer & explanation
Correct answer: 40
The sliding window counter estimate is 12 + 0.7 × 40 = 40.
Can you get the rest right without peeking?
Take the timed Quiz: Design a Rate Limiter quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →