← Questions
Tiered rate limiter with limits that change at runtime
0
I was asked this
No reports yet. Sign in to say where you were asked it.
Build a rate-limiting service in Python. Each client belongs to a tier (for example free, pro, enterprise), and each tier has its own limit. A request arrives with a client id, and the service decides whether to allow it under that client's tier.
- Implement the limiter and its interface.
- Let an operator change a tier's limits while the service runs, without a restart, and define what happens to clients mid-window.
- Write tests for it.
- Discuss how you would scale it beyond one process: shared state, accuracy versus latency, and failure behavior.
No official answer yet. Write yours on the right and run it.
Nothing published yet.
Sign in to submit your code; every attempt is kept here.
Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding
