All Questions
Api Design hard

You implement a Token Bucket rate limiter: bucket holds 100 tokens, refills 10 tokens/second. A client sends 100 requests instantly, then 10 req/sec. What happens?

  1. A The client successfully processes the initial 100 requests instantly from the bucket, and subsequent traffic is throttled to the exact refill rate of 10 requests per second.
  2. B All 100 requests are rejected immediately because the Token Bucket algorithm forbids any instantaneous burst that exceeds the long-term average refill rate of the system.
  3. C The bucket overflow mechanism triggers a temporary session-level ban, as the client's request velocity exceeded the predefined sustainable throughput for a single processing window.
  4. D The rate limiter automatically transitions the client to a 'Leaky Bucket' mode, where the requests are queued and processed at a constant rate of 1 request every 100 milliseconds.

One system design question a day, with spaced repetition so the ones you miss come back.

Get the app

Related questions