Consolidate Overlapping Maintenance Windows Per GPU Node
Last updated: November 29, 2026
Quick Overview
Given a list of maintenance windows as (node_id, start_hour, end_hour), merge overlapping or touching windows for each node and return the consolidated schedule per node.
Fluidstack
November 29, 20260
0
0 solved
Given a list of maintenance windows as (node_id, start_hour, end_hour), merge overlapping or touching windows for each node and return the consolidated schedule per node.
Fluidstack operates dedicated GPU clusters where firmware updates, cabling work and RMA swaps all book downtime on individual nodes, and customers want one clean view of when each node is unavailable. A phone screen uses this to check that you can sort, group and merge intervals cleanly and talk through boundary conditions.
What the Interviewer Expects
- Group windows by node before merging
- Sort each node's windows by start time
- Treat touching windows (end equals next start) as one block
- Ignore or reject zero-length and inverted windows explicitly
- State O(n log n) time and O(n) space
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 compute total node-hours lost across the whole cluster?
- How do you answer 'is node X available during [a, b)?' quickly after merging?
- What changes if windows stream in one at a time and must stay merged?
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: a list of (node, start, end) tuples with half-open intervals [start, end). Output: a dict from node to a sorted list of non-overlapping windows. Windows that overlap or touch merge, because...
High-Level Design
Bucket windows by node with a dict of lists. For each node, sort by start, then sweep: keep a current merged block and extend it while the next window starts at or before its end, otherwise close it a...