32. Design a Rate Limiter as a Service
The interview prompt
This chapter is a full interview round, played out step by step. The interviewer's lines are in quotes. At each step you'll see what a strong candidate says, the pushback the interviewer throws, and how to answer it. At the end, grade yourself with the rubric.
How to use this chapter
- Read only the prompt below. Then stop.
- Set a 45-minute timer and do the whole round yourself, on paper or a whiteboard, out loud. Use the framework from Chapter 1: READ, then Draw, Dive, Defend.
- Then read the walkthrough and compare. Score yourself with the rubric at the end.
Chapter 25 taught the algorithms. This round tests whether you can turn them into a shared service that many teams depend on, at high traffic, without becoming the thing that takes everyone down.
The prompt
"Our company has dozens of services. Every team builds its own rate limiting, badly. Design a rate limiter that any team can use: they say what to limit and how much, and your system enforces it."
Stop here. Start your timer.