Grammarly·Software Engineer·Onsite - System Design / Architecture
- Design and implement a rate limiter that supports token bucket, leaky bucket, fixed window, sliding window log, and sliding window counter algorithms, exposing an isAllowed(client_id) API with configurable per-client rate limits.
- How do you ensure correctness of your rate limiter under concurrent requests from the same client?
- What are the trade-offs between a centralized rate limiter using something like Redis versus a local in-process limiter on each node?
- Where do accuracy and memory usage conflict in rate limiting algorithm design, and how do you reason about that trade-off?
“I started with token bucket because it's the one I actually understand well, then kind of fumbled through leaky bucket.”