Skip to main content
All Questions

Design a distributed rate limiter for an internal service with per-API-key throughput limits.

Unlock detailed company stats for this questionUpgrade

Design a distributed rate limiter for an internal service that has a fixed throughput limit for each upstream service, based on an API key. One API key can be used by more than one service or instance. A request that cannot be served must not be rejected but queued somewhere and processed later. There should be no wasted capacity: if service-1 has spare capacity, service-2, which has reached its limit, should be able to use it. The service expects 10k RPS and can scale up to 1M RPS in future.

Expect follow-ups like

  • What if you do not want the network latency of calling a Redis cluster?
  • You have raised a PR for a feature and received many review comments. How do you deal with it and take it to closure?

Also asked as · Design a distributed rate limiter for internal microservice APIs.

Community answers

No answers contributed by the community yet.

Related courses

Course

Software Engineering Interview Prep

Land your dream software engineering role at Google, Amazon, Microsoft, Meta, Apple, and other top companies. Learn from mock interviews, frameworks, and advice from senior candidates—practice data structures, algorithms, system design, people management, behavioral interviews, and more.

Course

System Design Interviews

Learn how to answer the latest system design questions across product, infrastructure, and AI domains. Features in-depth video examples, written breakdowns, and helpful reference patterns. Watch senior engineers and managers answer these questions in mock interview videos.