Priority Backup Scheduler With a Fixed Number of Ingest Slots
Last updated: November 29, 2026
Quick Overview
Simulate a non-preemptive scheduler that runs backup jobs on k ingest slots, always starting the highest-priority waiting job, and return each job's completion time.
Rubrik
November 29, 20260
0
0 solved
Simulate a non-preemptive scheduler that runs backup jobs on k ingest slots, always starting the highest-priority waiting job, and return each job's completion time.
Rubrik clusters throttle how many snapshots ingest at once so they do not overload vCenter or production databases, while SLA-critical jobs still go first. The interviewer is testing event-driven simulation with heaps and careful tie-breaking.
What the Interviewer Expects
- Use one heap for waiting jobs and one for running jobs
- Jump time to the next event instead of ticking
- Break ties deterministically (priority, arrival, id)
- Handle idle periods with no ready jobs
- State O(n log n) complexity
Key Topics to Cover
How to Approach This
- Clarify input constraints and edge cases before writing code.
- Walk through your approach verbally and confirm with the interviewer before coding.
- Start with a brute force solution, then optimize. Mention time and space complexity.
- Test your solution with examples, including edge cases like empty input or duplicates.
- Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
- Low-priority jobs starve during a busy night. How would you add aging?
- Each vCenter allows at most 4 concurrent snapshots. How do you add per-source limits?
- How would you make jobs preemptible at chunk boundaries?
- How would you estimate which jobs will miss their SLA window before the night starts?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
Jobs (id, arrival, duration, priority), lower priority value runs first. Once started a job runs to completion. With slots workers, return {id: finish_time}....
High-Level Design
Keep ready as a min-heap on (priority, arrival, id) and running as a min-heap on finish time. Loop: admit arrivals up to now, fill free slots from ready, then advance now to the earlier of...