Katkat

Implement a leaky-bucket rate limiter

BoxSoftware Engineer · Onsite

Last updated

Implement a leaky-bucket rate limiter evaluates requirements, scale assumptions, API/data design, architecture, trade-offs, failure modes, and rollout in a realistic interview setting. A strong answer states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.

Implement a leaky-bucket rate limiter that enforces a maximum average request rate with a fixed drain rate. Write unit tests to validate steady-state, burst, and boundary conditions. Discuss how you would make the limiter safe under concurrency (multiple threads/processes) and how you would extend it for a distributed setting (e.g., shared state via Redis or a durable store), including consistency and failure-mode considerations.