Module 5.1: The Advanced SQL Power Round
The live SQL screen an intern actually sits: gaps-and-islands, sessionization, cohort retention, funnels, and advanced window frames.
Gaps and Islands: Consecutive Streaks and Run Detection
The most-failed pattern on the live SQL screen: find consecutive runs and the breaks between them with the row-number-difference template.
Sessionization: Grouping Events with an Inactivity Timeout
Stamp each event with the session it belongs to: LAG the gap, flag a new session past the timeout, running-sum the flag into a session id.
Cohort Retention and the Denominator Trap
Anchor cohorts on first activity, pin one definition of retained, and keep the FULL cohort as the denominator with a LEFT JOIN.
Funnel and Conversion Analysis
Collapse an event log to one row per user with MAX(CASE) step flags, enforce step order with timestamps, and read conversion between steps.
Advanced Window Frames and the QUALIFY Rewrite
The LAST_VALUE default-frame trap, ROWS vs RANGE on ties, why a window cannot go in WHERE, NTILE, and the QUALIFY rewrite.
Module 5.2: The Warehouse and Modeling Round
Modeling-round asks on a Snowflake, BigQuery, or Databricks-shaped stack: semi-structured JSON extraction, advanced fact grains, as-of joins, and join fan-out.
Semi-Structured Data: JSON/VARIANT Extraction and Array Flattening
Shred JSON into typed columns with the path operator, explode nested arrays with json_each, and avoid the double-count trap.
Fact Grains: The Accumulating Snapshot and UPDATE-in-Place
The three fact grains, and the one that mutates: build an accumulating-snapshot fact with NULLable milestone dates, computed lags, and an idempotent rebuild.
Point-in-Time (As-Of) Joins Against an SCD2 Dimension
Join a fact to the dimension version that was valid at event time using a half-open effective range, not the is_current row.
Join Fan-Out and Data Skew: Diagnose, Fix, and Keep Metrics Consistent
A join to the many side inflates a SUM; fix it by aggregating to the fact grain first, define the metric once, and surface hot keys.
Module 5.3: The Streaming and Pipeline Round
The operational reasoning the pipeline round scores: CDC changelog apply, high-water-mark incremental loads with safe backfill, and write-audit-publish quality gates.
CDC Changelog Apply: MERGE-Shaped Upsert with Deletes and Version Ordering
Apply an I/U/D change stream to a target: dedup to the latest version per key, upsert inserts and updates, delete tombstones, stay idempotent.
High-Water-Mark Incremental Extraction and Safe Backfill
Load only rows newer than a stored watermark, catch late arrivals with a partition-overwrite backfill, and stay idempotent per partition.
Write-Audit-Publish: Freshness, Volume, and Null-Rate Blocking Gates
Stage a batch to audit, run freshness/volume/null-rate violation checks, and publish to the served table only when every check returns zero.
Module 5.4: The DE System Design Round
Convert the verbal system-design round into runnable reasoning: partition pruning, consumer lag, tumbling windows, DAG eligibility, and an end-to-end medallion capstone.
Reasoning Like the System-Design Round: Pruning, Consumer Lag, Windows, DAG Deps
Make the four un-runnable system-design mechanisms concrete: sargable pruning, Kafka consumer lag, event-time tumbling windows, and DAG eligibility.
Capstone: JSON Events to a Sessionized, Incremental, DQ-Gated Medallion Pipeline
The whole level in one build: Bronze JSON to a deduped, sessionized Silver to a reconciling Gold aggregate, idempotent end to end.