Design a quota service
I was asked this
No reports yet. Sign in to say where you were asked it.
A system design interview question asked in Google's first round (coding) and at Snowflake, Amazon and 1 more company, last asked May 2026. It tests rate limiting, consistency and multi-tenant.
Design an internal quota service that several products share. For example, each user has one storage allowance of 100 GB, and file storage, photos and email all draw from that same pool. Before storing anything, a product asks the quota service whether the user has room. The service owns the one authoritative number of how much space each user has left, and must answer fast enough that products can wait on it.
Requirements
- Functional: consume quota; release quota (when data is deleted); query current usage and remaining quota; set and change limits per user or plan.
- Non-functional: never let a user go over their limit, even under concurrent requests from several products and regions; highly available; low latency; millions of daily users and high request rates.
Clarifying questions
- Is overdraft truly never allowed, or is a small temporary overshoot acceptable?
- Is a request a single step, or do products reserve space before an upload and confirm after?
- Are users served from several regions, and can one user write in two regions at once?
- What happens to quota reserved by an upload that never finishes?
- How should the service behave when it is unavailable: block writes or allow them?
What a strong answer covers
- An API with reserve, confirm, release and query, each with an idempotency key so retries never count twice.
- Quota states (available, reserved with a time limit, used) and a sweeper that expires abandoned reservations.
- A data model per user (limit, used, reserved) in a store with atomic conditional updates or transactions, and why strong consistency is needed here.
- Concurrency across products: compare-and-set or row locks so two simultaneous consumes cannot both pass the check.
- Partitioning by user, a home region per user for writes, and failover; whether caching is safe and how.
- Hot users, rate limiting and backpressure, reconciliation against actual stored data, and monitoring.
Follow-ups
- A product crashes after reserving quota and never confirms. What happens?
- A user's family plan shares one quota among five people.
- The primary region fails. How do you fail over without allowing overdraft?
- Products want to check quota without calling the service on every write.
Where it's asked
- Google · First round: coding · Last asked May 202645 min · Coding in a Google Doc, no syntax highlighting or autocomplete · No AI
- Snowflake · System design · Last asked Feb 202660 min · Design discussion
- Amazon
- Microsoft
What it tests
rate limiting · consistency · multi-tenant
Sign in to see the worked answer
The full answer, chapter by chapter, with what interviewers expect at each level. New accounts get 5 credits: each one unlocks a question for good.
What the labs asked this week
A weekly email of what OpenAI, Anthropic and the other top AI labs asked engineers, round by round.


