Katkat

Design a multi-tenant quota system

SnowflakeSoftware Engineer · Technical Screen

Last 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: (

  1. consume quota; (
  2. release quota; (
  3. 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.