5 guides
How to answer dbt interview questions
dbt questions test whether you have run a real project, not whether you know the commands. Interviewers listen for how you choose a materialization, handle late data in incremental models and keep tests useful. These guides show what to say and where answers usually go wrong.
- What are the materializations in dbt, and when do you use each?A materialization decides how dbt builds a model in the warehouse. The built-in ones are view (the default), table, incremental, ephemeral and materialized view. You choose by query cost, data size and how fresh the data must be.Beginner
- What are snapshots in dbt?A snapshot records how rows in a changing source table look over time, as a Type 2 slowly changing dimension. dbt adds validity columns such as dbt_valid_from and dbt_valid_to, and detects changes with the timestamp or check strategy.Beginner
- Why do we use ref() instead of hard-coded table names in dbt?ref() tells dbt that one model depends on another. dbt uses it to build models in the right order, to point at the right schema for each environment, and to draw the lineage graph.Beginner
- What are the built-in generic tests in dbt?dbt ships four generic data tests: unique, not_null, accepted_values and relationships. Each one compiles to a query that returns failing rows; the test passes when it returns none.Beginner
- How do incremental models work in dbt?On the first run dbt builds the whole table. On later runs, the is_incremental() block filters the source to new or changed rows, and dbt inserts or merges them into the existing table, matching on unique_key if you set one.Intermediate