Design a multi-tenant quota system
SnowflakeSoftware Engineer · Technical ScreenLast updated
This question evaluates a candidate's ability to design a global multi-tenant quota service, testing competencies in distributed systems, data consistency, concurrency control, API and storage modeling, and scalability within the System Design domain.
Design a global, multi-tenant quota service shared by multiple upstream products (e.g., Drive and Photos sharing 100 GB per user) where each user has a single global quota. Functional requirements: (
- consume quota; (
- release quota; (
- optionally query current quota. Non-functional requirements: never allow overdraft at any time; provide high consistency and high availability; target low latency where possible; scale to millions of DAU and QPS. Design prompts: define APIs (consume/reserve/confirm/release/query) and idempotency; choose storage and data model and justify ACID needs; describe read/write paths and replication/ack strategy to prevent double-spend; handle concurrency across services/regions and race conditions; model quota states (Available, Reserved with TTL, Occupied) and timeout/recovery; choose sync vs async for consume/release and failure handling/retries; propose sharding and multi-region disaster recovery/failover; decide on caching or no-caching and keep it consistent; add backpressure/rate limiting and hot-key mitigation; outline monitoring, SLOs, and capacity planning.
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.