Write a rate limiter for an API using the token bucket algorithm: an allow function takes a client identifier and returns whether its request can go through. Each client has a bucket capacity and a token refill rate per second, and the limiter itself is called from many threads at once.
~15 min by voice
How to approach it
They're checking whether you can turn a well-known algorithm into correct concurrent code: lazy time-based refill, an atomic check-and-debit, safe creation and removal of client state. They also look at whether you see the system as a whole: requirements, memory, and running on multiple instances.
The interviewer will ask this question and listen. Think out loud and ask for a hint if you need one. When you're done, pause or tap “That's my answer”. In about a minute, your score and the points you covered show up here.