Design a rate limiter
The classes inside an in-process rate limiter: one interface and three algorithms chosen per rule, an injected clock, lazy token refill, the fixed window's boundary flaw, one limiter per key with its own lock, and double-checked creation so a burst of first requests never builds two buckets.
01 · Two buckets for one client
LLD-03 · Design a Rate Limiter
A brand-new client. Two requests. The same instant.
Two first requests at once
A free user gets 5 searches a second.
0:00 / 13:49