Interview questions
Grain and table shape
1What is the grain of a table, and how do you test a grain declaration?
Grain is what one row is. Write it as one sentence: an "and" joining two kinds of thing, or an aggregate word such as "plus totals", reveals mixed grain, which leads to double counting.
Read moreGrain
2Why store data at the finest grain you can?
Aggregation cannot be undone, while storage is cheap: about $2.30 a month for 100 GB. Storing coarser saves little and risks a remodel plus restated reports. This is an economic argument, not a permanent law.
Read moreGrain
3Do we still normalize a warehouse to save space?
No. Dictionary and run-length encoding make repeated values nearly free, and reading only the columns needed makes unused width free. What normalization still buys is a single place where each fact is defined.
Read moreWhy the purpose no longer applies in analyticsWhat survives
4Why does a star schema work so well?
It splits data by how fast it changes: measures arrive once per event, while descriptions change rarely. Part of its advantage also comes from query optimizers that were built around this shape.
Read moreA rate-of-change split
5When should you snowflake a dimension, splitting it into sub-tables?
Only when the sub-entity has its own owner and lifecycle. Otherwise you just add join paths that consumers can get wrong.
Read moreSnowflake
Conformed dimensions
6What is a conformed dimension, and what does it save?
One shared dimension that means the same thing in every fact table that uses it. It turns N(N − 1)/2 pairwise reconciliations into N agreements.
Read moreThe economics
7What does a bus matrix tell you?
Which questions spanning several business processes can be answered: each filled cell is an agreement already paid for, each empty one a future project.
Read moreThe bus matrix
History and keys
8What is the difference between 'as was' and 'as is' reporting?
"As was" uses each attribute's value at the time the fact happened; "as is" uses today's value. One stored version of an attribute cannot answer both.
Read moreOne fact, two legitimate questions
9Summarize slowly changing dimension types 1, 2, 3, 4 and 6 in one line each.
- Type 1: overwrite; answers "as is" only.
- Type 2: a new row per change; answers both, but versions accumulate.
- Type 3: a previous-value column; one step of history.
- Type 4: move fast-changing attributes to a mini-dimension; bounds growth.
- Type 6: store both the historical and current values on every version; cheap reads, but writes must backfill.
Read moreThe slowly changing dimension types
10Why do surrogate keys exist?
Because type-2 history needs a key that tells the versions of one entity apart, and a natural key identifies the entity itself, so it cannot. Faster joins are a minor side benefit.
Read moreSurrogate keys versus natural keys
Measures
11Why can you not sum an account balance over a month?
A balance is a stock: the same amount persists from day to day, so summing over days counts it once per day. Over time, take the last value, the average, or the minimum and maximum.
Read moreWhy semi-additive measures cannot be summed over time
12How do you roll up a margin percentage?
Sum the numerator, sum the denominator, then divide. Never average the percentages.
13When do you need an accumulating snapshot fact table?
When the question is the time between milestones of a process, such as order placed to shipped to delivered. It is the one fact type whose rows are updated, so it is really a materialized view over events.
Read moreAccumulating snapshot
Many-to-many relationships
14What is a fan trap?
Joining a table at one grain to a table with several rows per row of the first, then summing the first table's measure: each value is repeated once per child row (the join multiplies rows). Aggregate to the measure's grain before joining.
Read moreFan trap
15What is the weighting factor in a bridge table?
An allocation policy stored as a column, such as splitting a deal 60/40 between two sales reps. It is a business decision, not a fact, and no data can validate it.
Read moreThe weight is an allocation policy
Modeling styles
16What does Data Vault modeling give you, and what does it cost?
Loading that does not depend on order, attribution of every value to its source, and resilience to schema change, through hubs (business keys), links (relationships) and satellites (attributes over time). The cost is complexity for readers, and you still build a star schema on top for analysis.
Read moreData VaultThe cost
17What is wrong with One Big Table, a single wide denormalized table?
Its grain is locked in, every dimension change means a rewrite, its "as was" history is frozen, and its vocabulary drifts. It is a materialized view that forgot its refresh policy.
Read moreOne Big Table
Meaning and identity
18Why do you need a semantic (metrics) layer?
A metric is a computation, not a stored value. Without one central definition, each consumer re-derives it, and the versions differ on unwritten edge cases. The layer also guards additivity and safe join paths.
19Why is the match threshold in entity resolution a business decision?
Merging too eagerly mixes two people's data, a privacy risk; splitting too eagerly inflates counts. The threshold sets the exchange rate between those two harms.
Read moreEntity resolution
Structure inside a model
20How do you store a hierarchy that changes often?
With a parent pointer (moving a node is cheap, finding all ancestors is slow), or with a closure table of all ancestor–descendant pairs if reads dominate (moving a node rewrites every pair under it). Avoid nested sets.
Read moreFour encodings
21When should you nest child records inside a parent rather than reference them in a separate table?
When the child has no independent identity or lifecycle, is always read together with its parent, and is bounded in size.
Read moreNested and repeated modeling
Pipelines
22What does a medallion layer (bronze, silver, gold) need to be worth having?
A published guarantee at each boundary (schema, freshness, uniqueness, null policy, grain) and a named owner. Otherwise it is just three copies of the data.
Read moreMedallion layering