
In mid-to-senior Analytics Engineering and Data Engineering loops, interviewers rarely evaluate candidates solely on whether they can write a LEFT JOIN or explain what dbt run does. Instead, they open with a realistic warehouse scaling dilemma: "Our SaaS commerce warehouse on Snowflake has 45 billion order-line events, and three BI teams are reporting three different Monthly Recurring Revenue numbers because everyone joins raw tables differently. Meanwhile, our nightly dbt build costs $1,400 per run because full refreshes rebuild massive denormalized tables from scratch. Should we model the marts layer as a classic Kimball Star Schema, flatten everything into One Big Table (OBT), or combine both? How do you structure the dbt project, prevent join fan-out bugs, and enforce grain guarantees in CI?"
Candidates who dismiss Kimball dimensional modeling as obsolete because columnar storage is cheap—or who insist on strict third normal form across an analytics warehouse—miss the central engineering tensions behind a dbt data modeling kimball star schema interview. Hiring panels use this scenario to evaluate whether a candidate understands grain discipline, columnar scan economics, conformed dimensions, incremental SQL idempotency, and automated dbt schema testing.
Mastering these modeling trade-offs strengthens any broader technical interview preparation roadmap for data platform and analytics roles. This guide compares Kimball Star Schema against One Big Table (OBT) in modern cloud warehouses, maps the canonical dbt staging-to-marts DAG, walks through production SQL and YAML test configurations, diagnoses a classic fan-out revenue bug, and provides an interview scoring rubric.
Why Warehouse Modeling Still Matters in Columnar Engines
A recurring misconception in data architecture interviews is that modern MPP columnar warehouses—Snowflake, BigQuery, Databricks Photon, and Redshift—eliminate the need for dimensional modeling. While columnar compression and vectorized execution dramatically lower the penalty of wide tables and unindexed joins compared to row-oriented OLTP databases, two hard constraints persist at scale:
- Semantic Drift Across Consumers: When analysts query raw normalized application tables or duplicate business logic across ad-hoc SQL views, metric definitions diverge. One dashboard filters refunded orders by
status != 'refunded', while finance excludes partial chargebacks at the line-item level. - Join Fan-Out & Compute Explosion: Joining two tables at different granularities (
ordersat order grain joined toorder_itemsandshipments) silently multiplies row counts and inflatesSUM(order_total)metrics—or triggers massive network shuffles across warehouse worker nodes when join keys are skewed.
Effective data warehouse data modeling solves both problems by declaring an explicit grain (what one row represents) and establishing a single governed contract between upstream ingestion pipelines and downstream BI or ML tools. For candidates comparing underlying storage and compute engines before designing the transformation layer, see our breakdown of Snowflake vs Databricks data architecture interviews.
Kimball Star Schema vs. One Big Table (OBT) in dbt
In a star schema, business processes are separated into fact tables (measurable events or transactions at a fixed grain, such as fct_order_lines or fct_subscription_invoices) and dimension tables (descriptive entities and attributes such as dim_customers, dim_products, and dim_dates). Dimensions are joined to facts via surrogate or natural foreign keys at query time.
In One Big Table (OBT) modeling, those dimension attributes are pre-joined into wide, flat, denormalized mart tables—such as obt_order_lines—so downstream BI tools and data analysts can aggregate metrics with zero runtime joins.

Architectural Trade-Off Matrix
When interviewers ask you to defend Star Schema versus OBT in a sql interview, anchor your reasoning in these seven operational dimensions:
| Evaluation Dimension | Kimball Star Schema (fct_* + dim_*) | One Big Table (obt_*) |
|---|---|---|
| Query-Time Joins | Requires runtime JOINs between fact and dimension tables; risk of fan-out if BI semantic layer is misconfigured. | Zero runtime joins for standard slices; simple SELECT ... GROUP BY queries for self-serve BI. |
| Columnar Scan & Compute | Reads narrow fact columns plus small broadcast-joined dimensions; cheap updates when a dimension attribute changes. | Wide rows improve single-table scan speed for fixed dashboards, but updating one customer tier forces rewriting billions of fact rows. |
| Conformed Dimensions & Governance | Enforces one shared dim_customers and dim_dates across Sales, Support, and Finance facts. | Repeated dimension columns across obt_orders, obt_tickets, and obt_invoices risk drifting definitions over time. |
| SCD Type 2 Historical Tracking | Native support via point-in-time joins (valid_from / valid_to) without rewriting historical facts. | Difficult to maintain retroactively; changing history requires backfilling multi-terabyte wide partitions. |
| Schema Evolution | Adding a column to dim_products is lightweight and isolated to a small table. | Adding or renaming an attribute ripples through massive incremental mart tables and downstream extracts. |
| BI Tool Compatibility | Ideal for semantic layers (dbt Semantic Layer, Looker LookML, Cube) that generate safe SQL joins. | Ideal for flat-table tools (Tableau extracts, Power BI single-table imports, ad-hoc Metabase explorers). |
| Best Hybrid Pattern in dbt | Build Star Schema in the core marts layer as the source of truth. | Expose OBT as a thin presentation/exposure layer built from the governed fct_* and dim_* models. |
The Senior Answer: Why Hybrid Wins in Production
In interviews, avoid treating Star Schema and OBT as mutually exclusive camps. The strongest production data pipeline pattern uses Kimball dimensional models as the governed core (marts/core/) and materializes wide OBT tables only as thin downstream presentation views or tables (marts/reporting/ or exposures) for latency-sensitive dashboards or non-SQL stakeholders. That way, business logic, surrogate keys, and SCD Type 2 history live once in tested star models, while BI tools still gain join-free read performance where benchmarks prove it helps.
Structuring the dbt DAG: Staging, Intermediate, and Marts
Interviewers frequently ask candidates to sketch a clean dbt folder structure and explain why raw source tables should never be referenced directly in BI dashboards.

1. Staging Layer (models/staging/)
- Materialization:
view(lightweight, zero duplicate storage). - Responsibility: One-to-one mapping with each raw source table (
stg_stripe__invoices,stg_postgres__orders). Performs light renaming, type casting, UTC timestamp normalization, and currency unit conversion (cents to dollars). - Hard Rule: Never perform cross-source joins or aggregations in staging models.
2. Intermediate Layer (models/intermediate/)
- Materialization:
ephemeralorview(occasionallytablefor heavy multi-pass deduplication). - Responsibility: Encapsulates complex business transformations that feed multiple marts—such as deduplicating CDC events, exploding nested JSON arrays, or unifying payment gateway states (
int_orders__enriched).
3. Marts Layer (models/marts/)
- Materialization:
tableorincremental(clustered/partitioned by event date). - Responsibility: Exposes clean business entities organized by domain (
fct_orders,fct_order_lines,dim_customers,dim_products). Every mart model must document its grain in YAML and pass automated uniqueness and referential integrity tests in CI before deployment.
To understand how upstream ingestion latencies (Kafka/Flink vs. scheduled Spark jobs) feed these dbt staging sources, compare streaming vs. batch ETL architectures.
Writing Production-Ready dbt SQL: Incremental Facts, Surrogate Keys, and Tests
During a live coding or whiteboard round, interviewers often ask for concrete SQL demonstrating how you prevent duplicates during incremental runs, generate deterministic keys, and track Slowly Changing Dimensions (SCD Type 2).
Example 1: Incremental Fact Model (fct_order_lines.sql) with Safe Lookback
A common mistake in incremental dbt models is filtering WHERE updated_at > (SELECT MAX(updated_at) FROM {{ this }}) without a lookback window or unique merge key. Late-arriving CDC events or clock skew cause silent missing rows. Using a unique_key with a bounded lookback window keeps incremental runs both fast and idempotent:
{{
config(
materialized='incremental',
unique_key='order_line_sk',
incremental_strategy='merge',
partition_by={'field': 'order_date', 'data_type': 'date'},
cluster_by=['customer_sk', 'product_sk'],
on_schema_change='sync_all_columns'
)
}}
with order_lines as (
select
order_line_id,
order_id,
customer_id,
product_id,
order_date,
quantity,
unit_price_usd,
discount_usd,
updated_at
from {{ ref('int_order_lines__deduped') }}
{% if is_incremental() %}
-- Reprocess a 3-day lookback window to capture late-arriving updates idempotently
where updated_at >= (
select dateadd(day, -3, max(updated_at)) from {{ this }}
)
{% endif %}
),
final as (
select
-- Deterministic surrogate key via dbt_utils avoids database auto-increment drift
{{ dbt_utils.generate_surrogate_key(['order_line_id']) }} as order_line_sk,
{{ dbt_utils.generate_surrogate_key(['order_id']) }} as order_sk,
{{ dbt_utils.generate_surrogate_key(['customer_id']) }} as customer_sk,
{{ dbt_utils.generate_surrogate_key(['product_id']) }} as product_sk,
order_line_id,
order_id,
order_date,
quantity,
unit_price_usd,
discount_usd,
(quantity * unit_price_usd) - discount_usd as net_line_revenue_usd,
updated_at
from order_lines
)
select * from final
Example 2: Enforcing Grain & Referential Integrity in schema.yml
Never treat dbt tests as optional documentation. In interviews, highlight how unique, not_null, and relationships tests guard the star schema contract—and how custom singular tests or dbt_expectations validate business invariants like non-negative net revenue:
version: 2
models:
- name: fct_order_lines
description: "One row per order line item. Primary fact table for gross and net revenue."
columns:
- name: order_line_sk
description: "Deterministic surrogate key at the order-line grain."
data_tests:
- unique
- not_null
- name: customer_sk
description: "Foreign key to dim_customers."
data_tests:
- not_null
- relationships:
to: ref('dim_customers')
field: customer_sk
- name: net_line_revenue_usd
description: "Net line revenue after item-level discounts."
data_tests:
- not_null
- name: dim_customers
description: "Conformed customer dimension enriched with SCD Type 2 plan history."
columns:
- name: customer_sk
data_tests:
- unique
- not_null
Handling SCD Type 2 History with dbt snapshot
When an interviewer asks: "How do you preserve a customer's subscription tier at the moment they placed an order two years ago, even if they upgraded yesterday?", explain Slowly Changing Dimension Type 2 (SCD Type 2):
- Define a
dbt snapshotonraw_customersusingstrategy='check'(comparingplan_tier,account_segment) orstrategy='timestamp'(updated_at), which automatically maintainsdbt_valid_fromanddbt_valid_tocolumns. - Generate a surrogate key combining
['customer_id', 'dbt_valid_from']indim_customers_history. - Join
fct_orders.order_created_at >= dim.dbt_valid_from AND fct_orders.order_created_at < coalesce(dim.dbt_valid_to, '9999-12-31')—or store the historicalcustomer_version_skdirectly on the fact row at ingestion time so downstream dashboards never have to write range joins.
For deeper query-tuning mechanics across relational warehouses and indexes, review SQL interview questions for data engineers and PostgreSQL B-Tree vs. GIN indexing optimization.
Production Debugging Scenario: Fixing Double-Counted Revenue (Fan-Out Join)
A signature dbt data modeling kimball star schema interview failure scenario goes like this:
"After last week's dbt deployment, Finance reports that total
order_shipping_usdjumped by 240% overnight—even though actual checkout volume stayed flat. No dbt tests failed. Walk through how you diagnose and fix the model."
Root-Cause Diagnosis
- Inspect Grain Mismatch: A developer joined
fct_orders(grain: 1 row per order) directly tostg_shipments(grain: 1 row per parcel, where split orders have 2–4 parcels) inside a combined mart or OBT model without pre-aggregating shipments. - Explain Why Tests Passed: Because the developer switched the primary key test to
order_id + parcel_id, theuniquetest still passed—even though order-level attributes (order_shipping_usd,order_discount_usd) were now duplicated across every parcel row! - Apply the Kimball Fix:
- Never mix two different grains in one fact table. Keep
fct_ordersstrictly at order grain andfct_order_shipmentsat parcel grain—or allocate order-level shipping proportionally if rolling down to a finer grain. - If building a pre-aggregated join, aggregate
stg_shipmentstoorder_idgrain before joining, and add a reconciliation test (usingdbt_utils.equalityor a singular SQL assertion checkingSUM(fct_orders.order_shipping_usd) = SUM(stg_orders.shipping_usd)).
- Never mix two different grains in one fact table. Keep
Understanding these grain invariants—alongside broader pipeline scaling concepts like database sharding vs. partitioning and core data engineering interview questions—separates practitioners who copy boilerplate SQL from senior engineers who protect financial accuracy.
Data Modeling Interview Evaluation Rubric
Interviewers grade candidates on architectural clarity, cost awareness, and operational rigor rather than textbook definitions. Compare weak answers against strong senior signals:
| Evaluation Dimension | Weak / Red-Flag Answer | Senior / Strong Hire Signal |
|---|---|---|
| Star Schema vs. OBT | "Star schema is legacy; we flatten everything into OBT in Snowflake because joins are slow." | Balances semantic governance and SCD Type 2 flexibility (Star Schema core) with optional OBT presentation marts for flat BI performance. |
| Grain Definition | "This table has all order and customer data together." | Explicitly states grain ("one row per order line item per SKU") and enforces it via deterministic surrogate keys plus unique and not_null tests. |
| Incremental Builds | Uses WHERE created_at > max(created_at) without merge keys or lookback windows. | Implements idempotent merge or delete+insert strategies with a late-arriving data lookback window and on_schema_change handling. |
| Fan-Out Prevention | Joins multiple one-to-many tables directly in BI or intermediate CTEs without checking row counts. | Separates facts by business process grain, pre-aggregates child CTEs before joining, and adds aggregate reconciliation tests in CI. |
| dbt Project Hygiene | Connects BI tools directly to staging or mixes source() and business aggregations in one file. | Enforces strict staging -> intermediate -> marts DAG layering, slim CI (state:modified+), and domain ownership. |
Practice Data Modeling & SQL Architecture Under Interview Pressure
Knowing the difference between Kimball conformed dimensions and OBT denormalization on paper is only half the challenge. In live interviews, hiring panels interrupt mid-whiteboard to probe edge cases—late-arriving facts, schema drift, incremental merge costs, and multi-grain fan-out bugs—giving you less than two minutes to defend your model cleanly.
- Test Your Recall in 60 Seconds: Start a rapid-fire session on the 60-Second Job Blitz to benchmark your SQL, data modeling, and system design instincts with zero login required.
- Rehearse Live with an AI Socratic Tutor: Paste a Data Engineer or Analytics Engineer job description into totop.app to generate tailored mock interviews, defend your dbt DAG and Kimball trade-offs aloud, and receive targeted Socratic follow-up probes on grain and incremental idempotency.
- Compare Plans & Start Free: Begin with 10 free AI interview practice tests or unlock unlimited voice and text simulations on the totop.app pricing page.
Practice Full Stack Engineer Questions Live with AI Mock Interviews
Turn any job description across Engineering, DevOps, Data, Marketing, Sales, Finance, or HR into a personalized test and live voice or text AI mock interview on totop.app, or test your speed right now in the 60-Second Full Stack Engineer Blitz.
Play 60s Full Stack Engineer Blitz (Free, No Login) | Start 14-Day Free Trial | Browse All Interview Guides