Practice 45 dbt interview questions on models, refs, sources, tests, documentation, snapshots, incremental models, seeds, macros, exposures, and deployment.
45 questions with answersKey Takeaways
dbt is a data transformation and analytics engineering tool. Teams write SQL models, connect them with ref and source, test assumptions, document datasets, and deploy transformations through version-controlled workflows. In interviews, dbt questions test whether you can design a clean model DAG, choose materializations, write data tests, handle incremental logic, manage environments, and keep analytics tables trustworthy.
Watch: What is dbt?
Video: What is dbt? (dbt Labs, YouTube)
Test yourself and earn a certificate
6 quick questions. Score 70%+ to download your dbt certificate.
Start here. These are the definitions and first-principle checks that open most rounds.
A dbt model is a SQL select statement that dbt materializes as a view, table, incremental table, or ephemeral model.
Models are nodes in the dbt DAG.
Model changes dbt decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Watch a deeper explanation
Video: What is dbt? (dbt Labs, YouTube)
ref references another dbt model and creates a dependency in the DAG.
Use ref instead of hardcoding relation names.
ref changes dbt decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
dbt DAG path
Tests can run at every layer.
A source declares raw upstream tables that dbt models depend on.
Sources can include freshness checks.
source changes dbt decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Materialization controls how dbt builds a model, such as view, table, incremental, or ephemeral.
Choose based on cost, speed, and use case.
Materialization changes dbt decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
| Answer part | What to say | Evidence to mention |
|---|---|---|
| Definition | Materialization in one direct sentence. | Official docs or course material |
| Use case | The work where it changes a decision. | Dataset, model, query, dashboard, or pipeline |
| Risk | What breaks when it is misunderstood. | Metric, log, test result, or review note |
Use a view when logic is light and freshness matters more than query speed.
Views can become slow if stacked too deeply.
View changes dbt decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Watch a deeper explanation
Video: dbt fundamentals (dbt Labs, YouTube)
Use a table when query performance matters and rebuilding cost is acceptable.
Tables need rebuild scheduling.
Table changes dbt decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
An incremental model processes only new or changed data after the first build.
It needs careful unique keys and late-data logic.
Incremental model changes dbt decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
An ephemeral model is inlined into downstream SQL instead of being created as a relation.
It fits small reusable transformations.
Ephemeral model changes dbt decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
A dbt data test checks assumptions about model data, such as not null, unique, relationships, or accepted values.
Tests should protect business logic.
Data test changes dbt decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
A generic test is a reusable test pattern configured in YAML.
not_null and unique are common examples.
Generic test changes dbt decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
A singular test is a custom SQL query that returns failing rows.
It fits business-specific rules.
Singular test changes dbt decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
A snapshot tracks changes to mutable source records over time.
It is useful for slowly changing dimensions.
Snapshot changes dbt decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
A seed is a small CSV file versioned in the dbt project and loaded into the warehouse.
Seeds fit small static reference data.
Seed changes dbt decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Watch a deeper explanation
Video: dbt models and tests (dbt tutorial, YouTube)
A macro is reusable Jinja logic used to generate SQL or project behavior.
Macros should reduce repetition without hiding too much.
Macro changes dbt decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
An exposure documents a downstream use such as a dashboard, notebook, ML model, or app.
It helps impact analysis.
Exposure changes dbt decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
These questions test whether you can apply the topic to real data, real code, and messy constraints.
Create one staging model per source table, rename fields, cast types, clean light source issues, and keep business logic minimal.
Staging creates a stable interface to raw data.
staging model changes dbt decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
# Interview check: split data, run baseline, inspect metric
from sklearn.metrics import accuracy_score
print(accuracy_score(y_true, y_pred))Join clean staging models, define grain, calculate measures, add keys, test uniqueness, and document metric definitions.
Grain must be explicit.
fact table changes dbt decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Choose unique key, filter new or changed rows, handle late arrivals, and test full refresh against incremental output.
Late data is the usual edge case.
incremental logic changes dbt decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Declare sources, set freshness thresholds, run freshness checks, and alert owners when upstream data is stale.
Freshness failures should block critical models.
source freshness changes dbt decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Add not_null and unique for primary keys, relationships for foreign keys, accepted values for enums, and custom tests for business rules.
Tests should protect data contracts.
dbt tests changes dbt decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Use snapshots when a source table updates records in place and you need history of changes.
Do not snapshot huge tables without reason.
snapshots changes dbt decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Use seeds for small static reference data such as mapping tables or codes.
Use warehouse tables for large or frequently changing data.
seeds changes dbt decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Use macros for repeated SQL patterns, cross-database helpers, and tests, while keeping generated SQL understandable.
Macros can become hard to debug.
macro use changes dbt decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Document model purpose, owner, columns, tests, source lineage, metric definitions, and downstream exposures.
Docs help users trust tables.
docs changes dbt decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Run changed models, dependencies, tests, linting where available, and compile checks before merge.
CI catches broken SQL and tests early.
CI job changes dbt decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Watch a deeper explanation
Video: dbt incremental models (dbt tutorial, YouTube)
Develop in dev schema, test in CI, deploy to production job, and monitor tests and freshness.
Environment separation protects production tables.
environment promotion changes dbt decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Selectors run subsets of the DAG by tag, path, state, model, or dependency graph.
They are useful for CI and backfills.
model selection changes dbt decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Plan affected dates, run full refresh or scoped rebuild, validate counts and metrics, then communicate changes.
Backfills can change historical dashboards.
backfill changes dbt decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Read compiled SQL, check upstream refs, inspect warehouse error, run dependencies, and test failing rows.
Compiled SQL is the fastest clue.
debug failure changes dbt decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
It centralizes metric definitions so dashboards and users calculate metrics consistently.
Metric ownership still matters.
semantic layer changes dbt decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Advanced rounds test trade-offs, failure modes, and whether the decision can hold up under production pressure.
Using ref and CI should catch dependency changes before production.
Hardcoded table names are fragile.
broken ref changes dbt decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Inspect model grain, joins, source duplicates, and incremental merge logic.
Do not ignore primary key failures.
duplicate primary key changes dbt decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Use a lookback window, merge strategy, or full refresh for affected periods.
Incremental filters need late-data rules.
late data changes dbt decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Source freshness checks and alerts should catch it.
Freshness is part of the contract.
stale source changes dbt decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Check snapshot strategy, updated_at field, change frequency, and whether history is truly needed.
Snapshots store history and cost money.
snapshot explosion changes dbt decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Reusability may be hurting readability.
Generated SQL should stay inspectable.
macro hides SQL changes dbt decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
A shared metric definition, owner, and tested model are missing.
dbt can centralize logic.
wrong metric changes dbt decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Materialize heavy models as tables or incremental models and profile warehouse queries.
Views are not free.
view stack slow changes dbt decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
The test may be poorly scoped, not owned, or not tied to a response.
Tests need actionability.
test noise changes dbt decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Validate against expected changes, document logic updates, and communicate downstream impact.
Historical changes need context.
bad full refresh changes dbt decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Target profiles, permissions, and environment separation are missing.
Protect production schemas.
environment mistake changes dbt decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Model compile, tests, source contracts, and CI should catch downstream breakage.
Raw changes need alerts.
source schema change changes dbt decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Exposures or lineage review should show downstream dependency.
Impact analysis needs metadata.
missing exposure changes dbt decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Use a warehouse load or source table instead.
Seeds are for small static data.
large seed changes dbt decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Ask about model layers, grain, refs, sources, tests, docs, materializations, CI, freshness, exposures, and ownership.
These decide whether analytics tables are trusted.
senior review changes dbt decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
dbt interviews often test whether you understand where raw data ends, transformed models begin, and history tracking belongs.
| dbt object | Purpose | Example | Risk |
|---|---|---|---|
| Source | Declare raw upstream data | raw.orders | Skipping freshness checks |
| Model | Transform data with SQL | stg_orders, fct_revenue | Building unclear dependencies |
| Snapshot | Track slowly changing records | customer status history | Using snapshots for every table |
| Seed | Version small static data | country codes | Using seeds for large data |
dbt answer signals
Good answers make the DAG trustworthy and maintainable.
Prepare by drawing a dbt DAG from raw sources to staging models, intermediate models, marts, tests, and exposures.
dbt interview prep flow
Most rounds reward clear reasoning more than memorized phrasing.
A strong dbt answer explains the DAG and the contract. Say where raw data is declared, how staging models clean it, which facts and dimensions are produced, what tests protect the model, and who owns downstream use. production-ready answers mention incremental edge cases, source freshness, snapshots, selectors, CI jobs, documentation, metric definitions, and rollback when a model breaks.
ref builds lineage and lets dbt order models correctly.
Unique, not null, accepted values, relationships, and custom tests catch broken logic.
Staging should clean and standardize source data, not hide heavy business logic.
Late-arriving data, deletes, and schema changes can break incremental models.
6 questions, about 4 minutes. Score 70% or higher to earn a shareable certificate.
Use this dbt bank for SQL transformation and testing answers, then practice SQL and data tasks with Hyring's AI Coding Interviewer.
See Hyring AI Coding Interviewer