Design: Rate Limiter — Concept Check
Questions on Design: Rate Limiter. A rate limiter service enforces request quotas per client using algorithms like token bucket or sliding window. It must be distributed (shared state via Redis), low-latency, and support tiered limits.
Questions in this quiz
7 questions on Design: Rate Limiter — Concept Check. Work through them here, then start the quiz to answer them and see your score.
1.Your API gateway is experiencing high latency after implementing a rate limiter. What could be a potential cause?
- ARate limiter is not distributed and causing a bottleneck.
- BThe rate limiter uses token bucket instead of sliding window.
- CThe rate limiter is enforcing soft limits.
- DRedis is not being used for shared state.
2.A client on a 'pro' tier makes 120 requests in a minute to the '/api/v1/orders' endpoint. What response will they receive after the 100th request?
- AHTTP 500 Internal Server Error
- BHTTP 403 Forbidden
- CHTTP 429 Too Many Requests
- DHTTP 200 OK
3.Which algorithm is more suitable for burst-friendly rate limiting?
- AFixed window
- BLeaky bucket
- CToken bucket
- DSliding window
4.A user reports receiving HTTP 429 responses despite being under their request limit. What might be the issue?
- AIncorrectly configured rules engine
- BSliding window algorithm is used
- CRate limiter is enforcing hard limits
- DRedis counters are not shared
5.How does a sliding window counter avoid the boundary burst problem?
- ABy allowing bursts of requests
- BBy using a leaky bucket algorithm
- CBy resetting counters at fixed intervals
- DBy using Redis sorted sets to track request timestamps
6.What response should a rate limiter send when a request exceeds the limit?
- AHTTP 200 OK
- BHTTP 401 Unauthorized
- CHTTP 429 Too Many Requests
- DHTTP 404 Not Found
7.Why might a rate limiter using a sliding window algorithm be preferred over a fixed window?
- AIt uses less memory.
- BIt allows for higher request bursts.
- CIt provides more accurate request counting.
- DIt is easier to implement.