Bird
0
0

A service wants to protect itself from burst traffic by allowing 100 requests per hour but also wants to allow short bursts of 20 requests per minute. Which rate limiting strategy best fits this need?

hard📝 Application Q8 of 15
Rest API - Rate Limiting and Throttling
A service wants to protect itself from burst traffic by allowing 100 requests per hour but also wants to allow short bursts of 20 requests per minute. Which rate limiting strategy best fits this need?
AUse only a fixed window limit of 100 requests per hour.
BUse a sliding window with limits of 20 requests per minute and 100 per hour.
CUse no rate limiting and rely on server capacity.
DUse a limit of 20 requests per hour only.
Step-by-Step Solution
Solution:
  1. Step 1: Understand the requirement

    The service needs both a short-term burst limit and a longer-term hourly limit.
  2. Step 2: Match strategy to requirement

    Sliding window with two limits allows controlling bursts and overall hourly usage.
  3. Final Answer:

    Use a sliding window with limits of 20 requests per minute and 100 per hour. -> Option B
  4. Quick Check:

    Sliding window fits burst and hourly limits = A [OK]
Quick Trick: Combine short and long limits with sliding window [OK]
Common Mistakes:
  • Using only hourly limit misses bursts
  • No rate limiting risks overload
  • Too low limit blocks normal use

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes