Case Study: The SQL Interview Gauntlet
Seven SQL problems that recur across almost every data engineering interview loop — funnels, retention, sessionization, deduplication, running metrics, Nth-highest-per-group, and year-over-year comparison — each fully worked with step-by-step reasoning, not just a final query
A worked answer key for the SQL problems that show up over and over in data engineering interviews, structured as seven realistic prompts with sample data and full solutions: funnel conversion analysis with drop-off rates, N-day retention by signup cohort, sessionizing a raw event log with a gap threshold, deduplication strategies compared (ROW_NUMBER, DELETE, DISTINCT ON), efficient running/cumulative metrics without a self-join, the classic Nth-highest-value problem generalized to Nth-highest-per-group with DENSE_RANK, and a this-year-vs-last-year cohort comparison in a single query. Each problem is reasoned from the execution model rather than pattern-matched from memory.
Practice questions (5)
-
View →
Median Salary Per Department, Two Ways
Advanced · Free -
View →
Longest Consecutive Active-Day Streak Per User
Advanced -
View →
Total Headcount Under Each Manager, Arbitrary Depth
Advanced -
View →
Pivoting Monthly Revenue by Category Into Columns
Advanced -
View →
Cumulative Revenue Share: Which Products Make Up 80% of Revenue
Advanced