Interview's MateData Engineer
Interview's Mate

Data Engineer

SQL · Spark · Lakehouse · Streaming

Visualizer

DSA Visualizer
All 32 lessons
Custom Playground
Try your own examples

Learning

System Design
31 architecture topics
SQL Learning
160 foundations → production topics
AI Engineering
160 LLM → backend topics
Data Science
160 Python → MLOps topics
Data Engineer
160 SQL → streaming topics
Docker
160 Docker learning topics
Kubernetes
160 K8s fundamentals → cloud
Java LearnSoon
Coming soon
Python Learn
Interview Q&A & internals
JavaScript Learn
Closures, async & DOM Q&A
Tech Learn
Search, practise & track Q&A
AI DSA Practice
Solve coding problems
Theme
Home
Data Engineer topics
Lesson 102/ 160
06. Data Transformation (dbt) & Workflow Orchestration

Introduction to dbt (Data Build Tool) & Analytics Engineering Workflow

Use dbt to version SQL transforms, tests, and docs as the analytics engineering workflow.

Beginnerdbt · Analytics Eng · SQL Transforms3 quiz questions
Practice Generative AI Q&A
In plain wordsDiagramTheoryStep by stepWhen to use itInterview cluesMistakes to avoidQuiz (3)Practice

In plain words

Warehouse raw tables and freshness. Next, staging/intermediate/marts with ref and source. Finally, docs, manifest, exposures, and run artifacts.

Think of it like…

dbt is a compiler and quality harness for the warehouse's SQL factory; an orchestrator is the shift calendar that decides when each factory line starts.

Where you’ve seen it

dbt build --select tag:daily+ compiles ref('fct_orders') dependencies, executes models/tests for the graph, and writes manifest.json/run_results.json for lineage, audit, and selective promotion.

Words you’ll hear

dbt
Data Build Tool, a framework for SQL/Jinja transformation graphs, tests, snapshots, docs, and adapters.
Analytics Eng
An analytics-focused role combining SQL model design, business semantics, software practices, and quality ownership.
SQL Transforms
Warehouse SQL nodes compiled from models and dependencies, not a replacement for arbitrary external ETL code.
Operational boundary
Treating dbt as an orchestrator or copying ad hoc dashboard SQL into models creates no extraction/retry contract, and a test declared but never scheduled cannot guarantee quality. Use dbt for transformations/tests/docs, let a source system and orchestrator own extraction/scheduling, compile models in CI, and run state-aware builds with failure policy and post-run artifact collection.

Visual diagram

Loading interactive diagram

Theory & deep dive

dbt: the working mechanism

dbt turns versioned SQL/Jinja models, tests, snapshots, documentation, and compilation into a dependency graph that a warehouse executes, while analytics engineers own modular business transforms.

Warehouse raw tables and freshness. Staging/intermediate/marts with ref and source, then compile SQL, run nodes, evaluate assertions; this exposes the state governed by SQL Transforms.

Introduction to dbt & Analytics Engineering Workflow in one concrete design

dbt build --select tag:daily+ compiles ref('fct_orders') dependencies, executes models/tests for the graph, and writes manifest.json/run_results.json for lineage, audit, and selective promotion.

Key takeaway: dbt turns versioned SQL/Jinja models, tests, snapshots, documentation, and compilation into a dependency graph that a warehouse executes, while analytics engineers own modular business transforms

Introduction to dbt & Analytics Engineering Workflow: failure mode and production response

Treating dbt as an orchestrator or copying ad hoc dashboard SQL into models creates no extraction/retry contract, and a test declared but never scheduled cannot guarantee quality.

Use dbt for transformations/tests/docs, let a source system and orchestrator own extraction/scheduling, compile models in CI, and run state-aware builds with failure policy and post-run artifact collection. Track Build selection as "models and dependent tests included explicitly", and make Manifest visible to the dataset owner.

Key takeaway: Use dbt for transformations/tests/docs, let a source system and orchestrator own extraction/scheduling, compile models in CI, and run state-aware builds with failure policy and post-run artifact collection.

How it works, step by step

Step 1 of 4
dbt

1. Define sources

Warehouse raw tables and freshness. dbt turns versioned SQL/Jinja models, tests, snapshots, documentation, and compilation into a dependency graph that a warehouse executes, while analytics engineers own modular business transforms.

warehouse raw tables and freshness
Key numbers at this step
Build selection
models and dependent tests included explicitly
Analytics Eng
An analytics-focused role combining SQL model design, business semantics, software practices, and quality ownership.

When to use it & trade-offs

What it is

dbt turns versioned SQL/Jinja models, tests, snapshots, documentation, and compilation into a dependency graph that a warehouse executes, while analytics engineers own modular business transforms. dbt build --select tag:daily+ compiles ref('fct_orders') dependencies, executes models/tests for the graph, and writes manifest.json/run_results.json for lineage, audit, and selective promotion.

Why it matters: Treating dbt as an orchestrator or copying ad hoc dashboard SQL into models creates no extraction/retry contract, and a test declared but never scheduled cannot guarantee quality. Use dbt for transformations/tests/docs, let a source system and orchestrator own extraction/scheduling, compile models in CI, and run state-aware builds with failure policy and post-run artifact collection.

When to reach for it

  • Use dbt to version SQL transforms, tests, and docs as the analytics engineering workflow.
  • Choose dbt because it provides this capability: Data Build Tool, a framework for SQL/Jinja transformation graphs, tests, snapshots, docs, and adapters.
  • Keep evidence for Build selection at "models and dependent tests included explicitly" so the last production stage-Publish evidence - docs, manifest, exposures, and run artifacts-remains testable.

When to avoid or be careful

  • Treating dbt as an orchestrator or copying ad hoc dashboard SQL into models creates no extraction/retry contract, and a test declared but never scheduled cannot guarantee quality.
  • Do not conflate Analytics Eng with dbt. The second concept contributes different behavior: An analytics-focused role combining SQL model design, business semantics, software practices, and quality ownership.
  • Release only after this guardrail is in place: Use dbt for transformations/tests/docs, let a source system and orchestrator own extraction/scheduling, compile models in CI, and run state-aware builds with failure policy and post-run artifact collection.

dbt / Analytics Eng / SQL Transforms - roles, limits, and operating cost

dbt
Best for: Data Build Tool, a framework for SQL/Jinja transformation graphs, tests, snapshots, docs, and adapters.

Strengths: Data Build Tool, a framework for SQL/Jinja transformation graphs, tests, snapshots, docs, and adapters. dbt turns versioned SQL/Jinja models, tests, snapshots, documentation, and compilation into a dependency graph that a warehouse executes, while analytics engineers own modular business transforms.

Watch out: Treating dbt as an orchestrator or copying ad hoc dashboard SQL into models creates no extraction/retry contract, and a test declared but never scheduled cannot guarantee quality.

Analytics Eng
Best for: An analytics-focused role combining SQL model design, business semantics, software practices, and quality ownership.

Strengths: An analytics-focused role combining SQL model design, business semantics, software practices, and quality ownership. In this workflow it supports: Build/test - compile SQL, run nodes, evaluate assertions.

Watch out: The operating cost is real: compile-time graph and model configuration artifact.

SQL Transforms
Best for: Warehouse SQL nodes compiled from models and dependencies, not a replacement for arbitrary external ETL code.

Strengths: Warehouse SQL nodes compiled from models and dependencies, not a replacement for arbitrary external ETL code. Its output can be checked with Run result.

Watch out: Operating guardrail: Use dbt for transformations/tests/docs, let a source system and orchestrator own extraction/scheduling, compile models in CI, and run state-aware builds with failure policy and post-run artifact collection.

Interview signals & numbers to know

When this topic comes up

  • “Where is the failure boundary for dbt, and how would Build selection reveal it?”
  • “Why is Analytics Eng distinct from this behavior: warehouse SQL nodes compiled from models and dependencies, not a replacement for arbitrary external ETL code?”
  • Production clue: Treating dbt as an orchestrator or copying ad hoc dashboard SQL into models creates no extraction/retry contract, and a test declared but never scheduled cannot guarantee quality.
  • Design probe: Use dbt for transformations/tests/docs, let a source system and orchestrator own extraction/scheduling, compile models in CI, and run state-aware builds with failure policy and post-run artifact collection.

Benchmarks & rules of thumb

Build selection -
models and dependent tests included explicitly
Manifest -
compile-time graph and model configuration artifact
Run result -
node status, timing, failures, and executed SQL evidence

Common mistakes & follow-ups

Common interview mistakes

  • Treating dbt as an orchestrator or copying ad hoc dashboard SQL into models creates no extraction/retry contract, and a test declared but never scheduled cannot guarantee quality.
  • Reporting success from a job exit code without checking Build selection and Manifest.
  • Treating this example as complete without replay, rollback, or access boundaries: dbt build --select tag:daily+ compiles ref('fct_orders') dependencies, executes models/tests for the graph, and writes manifest.json/run_results.json for lineage, audit, and selective promotion.

Likely interviewer follow-ups

  • How would you prove this contract instead of only checking that the command ran: Data Build Tool, a framework for SQL/Jinja transformation graphs, tests, snapshots, docs, and adapters.
  • What does the recovery plan do when this occurs? Treating dbt as an orchestrator or copying ad hoc dashboard SQL into models creates no extraction/retry contract, and a test declared but never scheduled cannot guarantee quality.
  • When is dbt insufficient for Manifest, and what does adding Analytics Eng cost in Build selection?
Interview tip: Lead with the data path and failure boundary: dbt turns versioned SQL/Jinja models, tests, snapshots, documentation, and compilation into a dependency graph that a warehouse executes, while analytics engineers own modular business transforms. Then make the answer operational: Use dbt for transformations/tests/docs, let a source system and orchestrator own extraction/scheduling, compile models in CI, and run state-aware builds with failure policy and post-run artifact collection.

Knowledge check

Loading quiz

Put it into practice

Practice related interview Q&A

Apply Introduction to dbt (Data Build Tool) & Analytics Engineering Workflow with data engineer interview Q&A and hands-on practice.

Open Data Engineer Q&A →Machine Learning Q&A
Previous topic
ETL vs ELT in Modern Cloud Data Platforms
Next topic
dbt Project Structure (models, seeds, snapshots, macros, tests)