Flag Performance Regressions in Nightly Benchmark Runs With SQL
Last updated: November 29, 2026
Quick Overview
Given a table of nightly benchmark results per benchmark, platform and commit, write a query that flags runs whose score dropped more than 3% below the average of the previous seven runs on the same benchmark and platform.
Arm
November 29, 20260
0
0 solved
Given a table of nightly benchmark results per benchmark, platform and commit, write a query that flags runs whose score dropped more than 3% below the average of the previous seven runs on the same benchmark and platform.
Arm runs large benchmark farms across Cortex and Neoverse models, FVPs and silicon to catch compiler and library performance regressions before release. The interviewer checks window function fluency and whether you think about noisy baselines and insufficient history.
What the Interviewer Expects
- Partition by benchmark and platform and order by run date
- Use a frame that excludes the current row
- Require a minimum number of prior runs before flagging
- Express the drop as a percentage for triage
- Discuss noise: mean versus median and outlier contamination
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 attribute a flagged regression to a specific commit range?
- Why might a median or trimmed baseline be better here, and how would you compute it?
- Some benchmarks are lower-is-better (latency); how do you handle both directions?
- How would you avoid alerting every night once a regression lands?
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
Table bench_runs(run_date, benchmark, platform, score, commit_sha), one row per benchmark, platform and night, higher score is better. Assume at most one run per key per night; if there are repeats,...
Approach
Compute, for each row, the average and count of the previous seven rows in the same partition using ROWS BETWEEN 7 PRECEDING AND 1 PRECEDING, so the current run never pollutes its own baseline. Then...