skip to content

Data Modeling for Analytics

How analytics data is shaped once it lands in a warehouse or lakehouse — facts and dimensions, slowly changing history, and the layered architectures teams build on top of them. Data-engineering and analytics-engineering interviews open here almost every time.

on this pageshow

explore

questions

118 · 4 sections

What is an aggregate fact table in a dimensional model, and why keep the atomic fact table too?

level: juniorimportance: must knowfreq 60%
basics
~20 s

An aggregate fact table stores the same measures as an atomic fact table, pre-summed to a coarser grain such as month-by-product. It is a derived performance copy; the atomic table stays as the source of truth for detail and rebuilds.

open as a page

What makes a dimension conformed across two star schemas in a warehouse?

level: juniorimportance: must knowfreq 72%
basics
~20 s

A conformed dimension is one shared dimension - the same table, or copies with identical keys, attribute names and attribute values - used by several fact tables, so grouping or filtering by it means exactly the same thing in every star.

open as a page

What is a degenerate dimension, and why does an order number stay in the fact row?

level: juniorimportance: must knowfreq 60%
basics
~20 s

A degenerate dimension is an operational identifier such as an order or invoice number stored directly in the fact table with no dimension table behind it, because every descriptive attribute it would carry already lives in other dimensions.

open as a page

What is a role-playing dimension, and how do you join one date dimension three times?

level: juniorimportance: must knowfreq 58%
basics
~20 s

A role-playing dimension is one physical dimension joined to the same fact table several times under different meanings — order date, ship date and due date — usually exposed as one view or alias per role so column names stay unambiguous.

open as a page

In a dimensional model, what distinguishes a fact table from a dimension table?

level: juniorimportance: must knowfreq 85%
basics
~20 s

A fact table holds the numeric measurements of a business process, one row per event at a declared grain, plus foreign keys to dimensions. A dimension table holds the descriptive attributes you filter, group and label by.

open as a page

In a Type 2 warehouse dimension, why does each version of a row get its own surrogate key?

level: juniorimportance: must knowfreq 78%
basics
~20 s

Because facts must point at the version of the dimension that was true when the event happened. The business key identifies the entity for its whole life; the warehouse surrogate key identifies one dated version of that entity.

open as a page

What is the difference between an SCD Type 1 and an SCD Type 2 change in a dimension table?

level: juniorimportance: must knowfreq 88%
basics
~20 s

A Type 1 change overwrites the attribute in place, so only the current value exists and history is lost. A Type 2 change retires the old row and inserts a new version, so old facts still report under the value that was true then.

open as a page

How does a hashdiff column detect changed rows in an SCD Type 2 dimension load?

level: middleimportance: must knowfreq 70%
basics
~20 s

A hashdiff hashes the concatenated tracked attributes of an incoming source row and compares that value to the hash stored on the key's current dimension version. Equal means skip the row; different means close the old version and insert a new one.

open as a page

An early-arriving fact references a customer key absent from the customer dimension — what are your options?

level: middleimportance: must knowfreq 55%
basics
~20 s

Never drop the row. Either route the fact to the dimension's reserved unknown member, or — the usual choice — insert an inferred placeholder dimension row carrying the natural key, and enrich it when the real record arrives.

open as a page

What does an SCD Type 3 previous-value column let a business report?

level: middleimportance: must knowfreq 60%
basics
~20 s

An SCD Type 3 column keeps one prior value beside the current one on the same dimension row, so the same measures can be reported under both the old and the new attribute at once. It captures a realignment, not a timeline.

open as a page

What is the core difference between the Kimball and Inmon data warehouse architectures?

level: juniorimportance: must knowfreq 72%
basics
~10 s

Inmon builds top-down: one normalized enterprise warehouse integrates every source, and dimensional marts are derived from it. Kimball builds bottom-up: dimensional marts per business process are the warehouse, tied together by shared dimensions.

open as a page

What is a data mart, and how is it different from the warehouse it draws from?

level: juniorimportance: must knowfreq 70%
basics
~20 s

A data mart is a subject-area slice of the warehouse: the facts and dimensions one business area needs, named in their vocabulary and owned by someone. The warehouse holds everything; a mart is a curated, governed subset for a specific audience.

open as a page

What belongs in the bronze, silver and gold layers of a medallion architecture?

level: juniorimportance: must knowfreq 78%
basics
~20 s

Bronze holds source data landed as received, duplicates and quirks included. Silver holds cleaned, typed, deduplicated and conformed entities at a declared grain. Gold holds business-ready output — dimensional models, aggregates and metric tables that reporting queries directly.

open as a page

What is a one-big-table (OBT) analytics model and what problem does it solve?

level: juniorimportance: must knowfreq 55%
basics
~20 s

A one-big-table model materialises a fact and all its dimension attributes into a single wide table, so analysts query it without joins. It buys simplicity and consumer safety, and pays in duplication, rebuild cost and lost dimension reuse.

open as a page

Why is an analytics model deliberately denormalized when its OLTP source schema is normalized?

level: juniorimportance: must knowfreq 82%
basics
~20 s

The two schemas are optimized for different jobs. A transactional schema normalizes so concurrent single-row writes stay consistent with one place per fact. An analytics model flattens attributes onto few wide tables so large read-only scans need fewer joins.

open as a page

Why doesn't a warehouse dimension that copies region names from a source lookup suffer update anomalies?

level: middleimportance: must knowfreq 60%
basics
~20 s

Because nothing updates those copies ad hoc. One scheduled load owns the table, re-derives the region name from the source on each run, and rewrites the affected rows, so the redundancy is recomputable derived data rather than an independent authority.

open as a page

How do you generate surrogate keys for a warehouse dimension when the platform has no reliable sequence?

level: middleimportance: must knowfreq 55%
basics
~20 s

Three families exist: an identity or sequence counter, a deterministic hash over the business key, or a random UUID. Hashing is the usual warehouse choice because it is reproducible, computable in parallel, and survives a full rebuild without renumbering.

open as a page

Why does a warehouse dimension carry an 'Unknown' member row instead of leaving the fact's key NULL?

level: middleimportance: must knowfreq 45%
basics
~20 s

A NULL dimension key drops the fact row from every inner join to that dimension, silently changing totals. A reserved Unknown member row keeps the fact joinable, so measures still add up and the missing value shows as its own visible bucket.

open as a page

Which changes to a published star schema are backward-compatible for existing reports, and which are not?

level: middleimportance: must knowfreq 66%
basics
~20 s

Additive changes — a new dimension attribute, a new dimension table, a new fact measure — leave existing queries valid. Grain changes, drops, renames and type changes break consumers loudly; redefining what an existing measure means breaks them silently, which is worse.

open as a page