Flag Idle GPU Jobs From Per-Minute Utilization Telemetry
Last updated: November 29, 2026
Quick Overview
Given per-GPU utilization samples for training jobs, write pandas code that finds jobs where every GPU stayed below 5% utilization for at least 30 consecutive minutes, returning the idle window for each.
Crusoe
November 29, 20260
0
0 solved
Given per-GPU utilization samples for training jobs, write pandas code that finds jobs where every GPU stayed below 5% utilization for at least 30 consecutive minutes, returning the idle window for each.
Idle reserved GPUs are wasted capacity for both Crusoe and its customers, and support teams want to alert customers whose job hung on a deadlock or a stalled data loader. The exercise checks gap-and-island logic, handling missing samples, and requiring the idle condition across all GPUs of a job at once.
What the Interviewer Expects
- Reduces to one value per job-minute using the busiest GPU, so all GPUs must be idle
- Builds consecutive runs with a change-point cumsum (gaps and islands)
- Breaks runs on missing minutes instead of bridging them
- Returns start, end and duration of each qualifying window
- Explains choices of thresholds and how to validate
Key Topics to Cover
How to Approach This
- Clarify the schema and expected output format before writing queries.
- Use CTEs (WITH clauses) to break complex queries into readable steps.
- Consider window functions (ROW_NUMBER, RANK, LAG, LEAD) for ranking and sequential analysis.
- Watch for NULLs, duplicates, and edge cases in JOINs and GROUP BY.
- For pandas, prefer vectorized operations over row-by-row iteration.
Possible Follow-up Questions
- How would you make this a streaming alert instead of a batch job?
- Some jobs are legitimately idle during checkpointing. How do you avoid false alarms?
- How would you scale this to billions of samples per day?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice SQL ProblemsSample Answer
Clarify the Data
Columns: job_id, gpu_id, ts (datetime), util_pct (0 to 100). Samples are roughly once a minute per GPU and may be missing. A job is idle in a minute only if its busiest GPU is under the thresh...
Approach
- Floor timestamps to the minute. 2) Take max utilization per job and minute. 3) Mark idle minutes. 4) Start a new run id when idle state changes or a minute is missing, via
cumsumon a boolean. 5)...