Skip to content
Tech Interview Prep
Technical interview guide

ETL for Reporting

The lighter-weight, reporting-focused data prep that sits between raw warehouse tables and a BI tool.

Minutes to read
3
Practice MCQs
25
Interview Q&A
25
Edition
v5
Editorial status
Reviewed

Scope: Current dbt, Google Dataform and BigQuery, Snowflake streams/tasks, Apache Airflow, Apache Iceberg, and OpenLineage guidance reviewed 2026-09-04.

Overview

Curated: · Written: · Reviewed:

ETL for Reporting

In one line

Reporting ETL shapes governed warehouse tables into facts, dimensions, snapshots and aggregates at a declared grain, so a dashboard number is reproducible, point-in-time correct and safe to rerun. Reach for it when a BI tool needs stable, conformed serving tables rather than raw ingestion.

Key definitions

  • Grain: what one row represents. State it before writing any transform.
  • Surrogate key: a warehouse-controlled key on a dimension, so a business key can be re-keyed upstream without breaking history.
  • Type 2 dimension: effective-dated versions with valid_from, valid_to and is_current, joined point-in-time.
  • Idempotent load: rerunning the same interval converges to the same target state, by partition replace or merge on a stable key.
  • Watermark: a completeness assumption, not proof that no older row will arrive.
  • Last-known-good publish: build and validate a new version, then swap it in atomically.

Formulas and complexity

A join's output row count is the sum of per-key products, so a fan-out multiplies rows silently:

rowsout=∑kLk⋅Rk\text{rows}_{\text{out}} = \sum_k L_k \cdot R_k

Distinct counts do not roll up by addition:

∣A∪B∣=∣A∣+∣B∣−∣A∩B∣|A \cup B| = |A| + |B| - |A \cap B|

Two days of 1,000 uniques give a two-day count between 1,000 and 2,000, never 2,000 unless the audiences are disjoint.

How it works

The source is deduplicated to the target grain in staging, then joined at that grain. The job builds a new partition or version, not the live one. Quality gates run at input, transform and output. A pass swaps the new version in atomically. A fail blocks publication and leaves the last-known-good version live.

pass fail Source extract or CDC Staging: dedupe to grain Transform: join at declared grain Build new partition or version Quality gates Atomic swap Block, keep last-known-good BI tool reads serving table

When to use and when not to

SituationChooseAvoid
Trend or cohort needs attributes as they were at sale timeType 2 dimension, point-in-time joinType 1 overwrite, or joining history to today's attribute
Source corrects records up to 72 hours after the eventReprocessing window at least 72 hours wide, merge on stable keyWatermark on max event time alone
Data must be filtered or masked before it landsETL, transform before loadELT default when the constraint is upstream of the warehouse
High-cardinality ID needed only for drill-throughDegenerate dimension on the factA dimension table that adds joins for no analysis
Ratios, distinct counts, balancesRecompute from base factsSumming pre-aggregated values

Traps interviewers probe

  1. Fan-out from a join at the wrong grain. An order with three lines carries its revenue three times. Fix: aggregate the child table to the parent grain before joining, and enforce uniqueness at the declared grain with a test.
  2. Historical facts joined to the current dimension. Revenue by segment is reclassified whenever a customer moves. Fix: join on fact_date BETWEEN valid_from AND valid_to, with non-overlapping intervals.
  3. Summing daily uniques into a monthly figure. Fix: recompute the distinct count from base facts.
  4. Watermark-only incremental. A watermark never sees a correction to an old row. Fix: reprocess an overlap window at least as wide as the correction horizon, and merge on a stable key.
  5. Treating a successful task as correct data. An empty source publishes zeros and the scheduler reports green. Fix: check row count against the source manifest and reconcile to the source. Never turn a failed or partial load into zeros.

Interview tips

Open with the grain and the key: "Before the transform, I'd state the grain of this table and the key it must be unique on." Then say how history is handled, Type 1 or Type 2 and why.

Follow-ups to expect: backfilling six months without double-counting (partition replace, same code as the scheduled run); versioning a metric definition change; rolling back a bad publish (last-known-good); handling a late correction (overlap window and recorded load interval).

30-second outline: grain and keys first. History strategy second, with the reporting question that decides it. Idempotent load by partition or stable-key merge. Incremental with an overlap window sized to the correction horizon. Gates that block, then atomic publish. Reconcile aggregates to base facts.

Feedback on this overview

Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.