Plan Rolling Firmware Upgrade Waves With Rack Limits
Last updated: November 29, 2026
Quick Overview
Given each node's rack, a map of upgrade dependencies (a switch must be upgraded before nodes behind it), and a cap on how many nodes per rack may be down at once, produce the sequence of upgrade waves, or report a cycle.
Fluidstack
November 29, 20260
0
0 solved
Given each node's rack, a map of upgrade dependencies (a switch must be upgraded before nodes behind it), and a cap on how many nodes per rack may be down at once, produce the sequence of upgrade waves, or report a cycle.
Fluidstack rolls out GPU driver, BIOS and NIC firmware across clusters that customers are actively using, so it must respect ordering constraints and keep enough capacity online in every rack. The interviewer wants to see topological sort applied to a real operational constraint, plus the extra per-wave capacity rule.
What the Interviewer Expects
- Model dependencies as a DAG and use Kahn's algorithm
- Apply the per-rack cap within each wave and defer the rest
- Detect cycles and fail loudly
- Produce deterministic output
- Explain why waves are minimal or where the greedy may not be optimal
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
- How would you handle a node that fails its upgrade mid-wave?
- How would you add a global cap on total nodes down, not just per rack?
- Is the greedy wave count optimal? Give a case where it is not.
- How do you prioritise nodes on the critical path of the dependency graph?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
Input: rack_of maps every node to its rack, deps maps a node to prerequisites that must finish in an earlier wave, per_rack_cap bounds nodes per rack per wave. Output: list of waves (lists of no...
High-Level Design
Kahn's algorithm in levels. The ready set holds nodes whose prerequisites are all done. Each wave walks the sorted ready set and admits a node only if its rack is under the cap; others are deferred to...