How would you design a rate limiter for a public API?
Choose the key, the algorithm, and what the client sees when it is limited.
Mid-level and senior candidates
Capacity, failure, and the tradeoff you would write on the board first.
Choose the key, the algorithm, and what the client sees when it is limited.
Cover id generation, the read path, and what you cache.