Find Core Web Vitals Regressions Between Consecutive Production Deployments

Last updated: November 29, 2026

Quick Overview

Given a table of real-user LCP measurements tagged with project, route and deployment, compute p75 LCP per route for each production deployment and flag routes where p75 got at least 20% worse than the previous production deployment with enough samples.

Vercel
Data Manipulation (SQL/Python)
Data Engineer
Vercel
November 29, 2026
Data Engineer
Technical Screen
Data Manipulation (SQL/Python)
Medium

0

0

0 solved


Given a table of real-user LCP measurements tagged with project, route and deployment, compute p75 LCP per route for each production deployment and flag routes where p75 got at least 20% worse than the previous production deployment with enough samples.

Vercel Speed Insights reports Core Web Vitals at the 75th percentile and ties them to deployments, so teams can see which release slowed a page down. The interviewer checks percentile aggregation, window functions over deployment order and good judgment about sample sizes.

What the Interviewer Expects
  • Aggregate with a true percentile (percentile_cont), not an average
  • Order deployments by their creation time per project, not by measurement time
  • Use LAG over deployments within each project and route
  • Apply a minimum sample threshold before flagging
  • Explain why routes absent from one deployment need care
Key Topics to Cover
Percentiles
Window functions
LAG
Sample size thresholds
Core Web Vitals
How to Approach This
  1. Clarify the schema and expected output format before writing queries.
  2. Use CTEs (WITH clauses) to break complex queries into readable steps.
  3. Consider window functions (ROW_NUMBER, RANK, LAG, LEAD) for ranking and sequential analysis.
  4. Watch for NULLs, duplicates, and edge cases in JOINs and GROUP BY.
  5. For pandas, prefer vectorized operations over row-by-row iteration.
Possible Follow-up Questions
  • How would you compute this incrementally every few minutes on a streaming table?
  • Device mix shifts between deployments. How would you control for mobile vs desktop?
  • How would you choose the 20% threshold and minimum sample size statistically?
  • How would you do this at billions of rows where exact percentiles are too expensive?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice SQL Problems
Sample Answer
Clarify the Data

Tables:

  • vitals(project_id, deployment_id, route, metric, value_ms, device, recorded_at) with metric = 'LCP' for this question. route is the route pattern (/blog/[slug]), not the raw URL, so ...
Approach
  1. Join vitals to production deployments and compute p75 and sample count per (project, deployment, route).
  2. Use LAG partitioned by (project_id, route) ordered by deployment created_at to ge...

Submit Your Answer
Markdown supported

Related Questions