Data Analytics

dbt - Fundamentals

dbt project, models, sources, refs, tests, documentation, materializations, seeds

20 interview questionsยท
Mid-Level
1

What is dbt (data build tool)?

Answer

dbt is a data transformation tool that allows analysts and data engineers to write transformations in SQL or Python directly in the data warehouse. It follows the ELT (Extract, Load, Transform) approach where data is first loaded into the warehouse then transformed in place, unlike traditional ETL which transforms before loading. dbt manages model dependencies, tests, and documentation automatically.

2

What is the basic structure of a dbt project?

Answer

A dbt project is organized around key folders: models/ contains SQL files defining transformations, seeds/ holds CSV files loaded as tables, tests/ stores custom tests, macros/ has reusable Jinja functions, and snapshots/ keeps state captures. The dbt_project.yml file at the root configures the project (name, version, default materializations), while profiles.yml defines warehouse connections.

3

What is a model in dbt?

Answer

A dbt model is a SQL file containing a SELECT statement that defines a data transformation. Each model corresponds to a .sql file in the models/ folder and produces a table or view in the data warehouse when executed. Models can reference other models via the ref() function, creating a dependency graph (DAG) that dbt executes in the correct order.

4

What is the purpose of the ref() function in dbt?

5

What is a source in dbt and how to declare one?

+17 interview questions

Master Data Analytics for your next interview

Access all questions, flashcards, technical tests, code review exercises and interview simulators.

Start for free