Design Fair-Share Slot Allocation for BigQuery Reservations
Last updated: November 29, 2026
Quick Overview
Design how BigQuery divides a customer's purchased compute slots among projects and concurrent queries so that one huge query cannot starve everyone else, while idle capacity is still borrowed by whoever needs it.
0
0
0 solved
Design how BigQuery divides a customer's purchased compute slots among projects and concurrent queries so that one huge query cannot starve everyone else, while idle capacity is still borrowed by whoever needs it.
BigQuery's reservation model is a quota problem with a scheduling twist, and it comes up for Cloud data infrastructure roles. The interviewer is checking hierarchical fair sharing, idle-capacity borrowing, and how the scheduler reacts within seconds as queries start and finish.
What the Interviewer Expects
- Model a hierarchy: organization reservation, then assignments to projects, then queries
- Explain fair sharing with idle slot borrowing
- Describe how slots are reassigned as query stages start and end
- Handle concurrency limits and queueing when demand exceeds capacity
- Expose usage so admins can right-size reservations
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 prevent a borrowing project from hurting the owner when the owner's load returns?
- How would autoscaling reservations change the design?
- What metrics would tell an admin they need more slots?
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
- An organization buys, say, 2,000 slots and creates reservations (ETL: 1,200, BI: 800). Projects are assigned to reservations.
- Within a reservation, concurrent queries share slots fairly; a single ...
High-Level Design
- Reservation config service: stores reservations, assignments, and baseline capacity.
- Slot scheduler (per region): tracks demand from every running query stage and computes each query's cur...