Juniper API asks you to stop a few API keys from flooding its 12 gateway nodes. The fictional peak is 50,000 requests/s. Each key may make 100 requests a minute with short bursts. Deliver the requirements, a counter load estimate, a quota API, the limiter path on the board, atomic counter updates, an outage policy and an algorithm choice.
How interviewers level this design
- Junior: places the limiter before the service, keys it by API key and returns 429 with a retry time.
- Mid-level: explains why per-node counters fail, makes updates atomic and sizes the counter store.
- Senior: chooses fail-open or fail-closed per customer promise, bounds the burst at window edges and plans for hot keys and regional limits.
Juniper API sells access by API key, and a few keys are flooding it. Every gateway node can see only its own traffic, so a limit counted per node lets a client spread requests across nodes and pass several times its quota. The limit has to be shared.
You will work through the full interview arc: what the limiter promises, how much counter traffic it creates, the response a limited client receives, where the limiter sits on the request path and how counters stay correct when two gateways update the same key at once. Then you will decide what happens when the counter store is unreachable, because a limiter that fails closed can take the whole API down with it.
Share one limit per API key across gateways, keep counters atomic and choose behavior when the counter store fails.