skip to content

dbt

Transformation as version-controlled SQL: models referencing each other, materializations, tests, snapshots and Jinja macros, all executed inside the warehouse. Interviewers ask about dbt because it is how analytics engineering brought software practice to SQL.

on this pageshow

explore

questions

page 2 of 2

How do you decide how much Jinja templating a dbt project should allow in its models?

level: principalimportance: should knowfreq 38%

basics

~20 s

Allow Jinja that removes duplication without hiding what a model does: shared expressions, environment switches, config. Ban templating that decides a model's grain, joins or output columns, because reviewers then read a template while the warehouse runs something else.

open as a page

When should reference data live as a dbt seed rather than a pipeline-loaded table?

level: principalimportance: should knowfreq 36%

basics

~20 s

Seed it when the analytics team is the system of record and the data is small, slow-moving and non-sensitive, so a pull request is the right change process. Ingest it when an upstream system already owns the data or it changes often.

open as a page

In dbt, what does the ephemeral materialization do to a model's compiled SQL?

level: middleimportance: nice to knowfreq 36%

basics

~20 s

An ephemeral dbt model creates no object in the warehouse. Its SQL is interpolated as a common table expression into every downstream model that refs it, so the logic is reusable in dbt but not queryable outside it.

open as a page

In a dbt snapshot table, what does the dbt_scd_id column identify?

level: middleimportance: nice to knowfreq 26%

basics

~20 s

dbt_scd_id is a generated hash that uniquely identifies one version row in a dbt snapshot — the entity's unique_key combined with the timestamp that version starts at. It is dbt's internal row identity, not a business key.

open as a page

A dbt seed of ZIP codes loads as integers and loses leading zeros — how do you fix it?

level: middleimportance: nice to knowfreq 34%

basics

~20 s

dbt infers seed column types from the CSV contents, so an all-digit column becomes numeric. Pin it with a column_types config naming the column as a string type, then run dbt seed with full refresh so the table is dropped and recreated.

open as a page

In dbt, how do you write a custom generic test that can be reused from schema YAML?

level: middleimportance: nice to knowfreq 36%

basics

~20 s

Define a Jinja block with the test tag taking model and column_name arguments, save it under tests/generic or macros, and return the failing rows. Any model's YAML can then declare it by name and pass extra arguments.

open as a page

In dbt, how does adapter.dispatch let one macro work across Snowflake and BigQuery?

level: seniorimportance: nice to knowfreq 28%

basics

~10 s

adapter.dispatch resolves a macro name to an adapter-prefixed implementation at compile time: on Snowflake it looks for snowflake__my_macro and falls back to default__my_macro. You write one entry point plus one implementation per warehouse.

open as a page

In dbt, what do model access levels and groups control about who can ref() a model?

level: principalimportance: nice to knowfreq 25%

basics

~20 s

Access marks a model private, protected or public. Private models can only be referenced from within their own group, protected ones from within the project, and public ones are the declared interface other projects may reference — turning the graph into an ownership boundary.

open as a page

showing 31–38 of 38