Detect Nodes With Repeated Critical XID Errors in 24 Hours
Last updated: November 29, 2026
Quick Overview
Given a table of GPU error events (node_id, gpu_index, event_ts, xid), write SQL that returns every node with at least three critical XID events inside any rolling 24-hour window, with the time the threshold was first crossed.
Coreweave
November 29, 20260
0
0 solved
Given a table of GPU error events (node_id, gpu_index, event_ts, xid), write SQL that returns every node with at least three critical XID events inside any rolling 24-hour window, with the time the threshold was first crossed.
Fits telemetry and fleet analytics work at a GPU cloud, where repeated hardware errors on a node feed RMA decisions and auto-repair policies. The interviewer checks rolling windows done right (time-based, not row-based) and care with duplicates and boundaries.
What the Interviewer Expects
- Uses a RANGE window over time, not ROWS
- Filters to critical XIDs before windowing
- Defines the window boundary precisely (inclusive or exclusive 24h)
- Dedupes repeated log lines for the same event
- Returns first crossing time per node
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 incremental over a stream instead of a nightly batch?
- How would you also require the errors to come from the same GPU?
- How do you avoid counting a single burst (one event logged 50 times) as three errors?
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
gpu_events(node_id text, gpu_index int, event_ts timestamptz, xid int). Critical XIDs: 48, 79, 94, 95. Agents can retry log shipping, so the same (node_id, gpu_index, event_ts, xid) may appear twi...
Approach
- Dedupe and filter to critical codes. 2) For each event, count events on the same node in the trailing 24 hours using
RANGE BETWEEN INTERVAL '24 hours' PRECEDING AND CURRENT ROW; a ROWS frame woul...