Design a geo-distributed rate limiter
PlaidSoftware Engineer · Technical ScreenLast updated
This question evaluates a candidate's competency in designing geo-distributed, globally consistent rate limiting systems that enforce per-API-key and additional constraints while balancing low-latency request paths and regional failure tolerance.
Design a rate limiting system that works across multiple geographic regions (e.g., us-east, eu-west, ap-south).
Requirements:
- Enforce per-API-key limits (e.g., 100 requests/sec) and possibly additional limits (per-IP, per-endpoint).
- Requests can hit any region; the limit should be respected globally (not multiplied by number of regions).
- Low latency in the request path; tolerate region failures.
Follow-up: You have a worker system that must execute tasks under rate limiting, and you are considering two scheduling strategies:
- Prioritize tasks with the largest cost/weight first.
- Prioritize executing as many tasks as possible (maximize throughput / number of tasks).
Explain pros/cons of each strategy and when you would choose which.
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.