Interview practice question
Low-level design of a rate limiter class
Backend Engineering · OOP and Design Patterns · Experienced
Design the classes for an in-process rate limiter library that supports token bucket and sliding window algorithms and per-key limits.
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- RateLimiter interface: tryAcquire(key).
- Strategy per algorithm.
- Per-key state in concurrent map.
- Injectable clock for tests.
- Thread safety; eviction of idle keys.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.