Design quota enforcement for high concurrency
GoogleSoftware Engineer · Technical ScreenLast updated
This question evaluates a candidate's understanding of distributed system design and engineering competencies related to quota enforcement, high-throughput rate limiting, consistency models, sharding, and concurrency control under very high QPS.
Design a quota enforcement service used by many services for API or storage quotas under very high request rates. Define the APIs to check and increment usage, and discuss strategies for strong versus eventual consistency, hot-key sharding, rate limiting, and correctness when concurrent requests arrive. Explain how to reconcile temporary overage under eventual consistency for billing, and how to ensure low-latency, high-availability enforcement.
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.