Design Shared Storage Quota Accounting Across Gmail, Drive, and Photos
Last updated: November 29, 2026
Quick Overview
Design the service that tracks each Google account's storage usage across Gmail, Drive, and Photos against one shared quota (including Google One family plans) and blocks uploads once the limit is reached.
0
0
0 solved
Design the service that tracks each Google account's storage usage across Gmail, Drive, and Photos against one shared quota (including Google One family plans) and blocks uploads once the limit is reached.
A Google onsite question about correctness under concurrency rather than raw scale. The interviewer checks how you aggregate usage from independent products, keep the counter accurate, and enforce limits without a global lock on every write.
What the Interviewer Expects
- Keep per-product usage counters and aggregate them per account
- Make usage updates idempotent and derived from durable events
- Enforce quota with soft reservations for large uploads
- Run periodic reconciliation against product ground truth
- Handle family plans where several users share one pool
Key Topics to Cover
How to Approach This
- Start by clarifying functional and non-functional requirements with the interviewer.
- Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
- Draw a high-level architecture first, then deep dive into 1-2 critical components.
- Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
- Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
- How do you stop two parallel 5 GB uploads from both passing a check with 6 GB left?
- How do you handle a user who deletes files to get back under quota?
- How quickly must a Google One upgrade take effect?
- How would you detect counter drift?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
Requirements
- Usage = Gmail bytes + Drive bytes + Photos bytes (trash counts until purged).
- Quota = base 15 GB or a Google One plan; family plans pool storage across up to 6 members.
- Writes: billions of file ...
High-Level Design
- Each product emits usage delta events
(account, product, object_id, delta_bytes, op_id)to a durable log when objects are created, resized, or purged. - Quota Service (Spanner) stores `acc...