← Questions

Tiered rate limiter with limits that change at runtime

0
SnowflakeCodingLast asked Aug 2026

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.

  1. Implement the limiter and its interface.
  2. Let an operator change a tier's limits while the service runs, without a restart, and define what happens to clients mid-window.
  3. Write tests for it.
  4. Discuss how you would scale it beyond one process: shared state, accuracy versus latency, and failure behavior.
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