All jobs / DevOps / SRE / cloud
DevOps / SRE / cloud interview question · 1–3 years
Design a rate limiter: which algorithm and where does its state live?
The strongest answer
Token bucket or sliding window per client key, with the counters in a fast shared store like Redis so every gateway instance sees the same count; say what happens when the store is down — fail open or closed — because that is the real design decision
Why it works
Right. Shared, fast state, and a stated failure mode.
What a good answer covers
- Token bucket or sliding window.
- Shared fast store for counts.
- Keyed per client.
- Decide fail-open vs fail-closed.
Answers that fall short
- Close, but not the strongest: A counter in each gateway's memory, reset every minute
Per-instance counters let a client get N times the limit. - Weak: A row in the main database updated on each request
The main database cannot take a write per request. - Red flag: Block clients that look suspicious
A limiter counts; it does not judge.
Who gets asked this
- Backend developer
- Full-stack developer
- DevOps / SRE / cloud
- Data engineer
- Data science / ML / AI
- Engineering manager / tech lead
- Solutions / cloud architect
- AI engineer
More DevOps / SRE / cloud questions
- Active-passive versus active-active across regions — what does active-active cost you beyond money?
- A hot cache key expires and 5,000 requests miss at once. Design against it.
- How do you limit the blast radius of a failure in a system serving millions?
- Your DR runbook is a document. How do you make it real?
- A user has an allow policy for an action and their group has a deny for it. What happens?
- URL shortener: how do you generate the short code?
- A service on a VM needs to read from a storage bucket. How does it get permission?