dbt CI/CD Interview Questions

Reviewed by Mark Dickie · Last updated

9 questions on this page you can answer and see marked on the spot. Go to the first one

dbt CI/CD is the practice of automating how dbt models are tested, built, and promoted across development, staging, and production environments using continuous integration and continuous deployment pipelines. For an interview, you should know how to run dbt build in a CI job, use dbt parse to catch issues early, and apply selectors like --select state:modified+ so CI only runs what changed, which requires --state pointing at a production manifest.json (typically with --defer) or the command will fail or run everything. You should also be able to explain environment promotion patterns (cloning databases, using separate schemas, or using dbt Cloud environments), how to handle schema drift, and where testing fits into the pipeline.

The table below maps the core dbt CI/CD concepts interviewers probe:

ConceptWhat to know
dbt buildRuns seeds, models, tests, and snapshots in DAG order; use in CI jobs
State-based selection--select state:modified+ runs only changed models and downstream dependents
Defer / --deferLets a CI run reference production artifacts without rebuilding everything
Environment promotionApproaches: copy/clone schemas, dbt Cloud job environments, or separate targets per env
Artifactsmanifest.json and run_results.json enable state comparison and observability
dbt parse / dbt compileLightweight checks: parse validates project structure, YAML, refs and config; compile renders SQL from Jinja and may still connect to the warehouse for introspective macros

What does a dbt CI/CD interview test?

Interviewers want to see that you can design a pipeline where every pull request triggers a controlled dbt run, catches broken models before merge, and keeps production stable. Expect questions on these areas:

  1. How to scope CI runs so they finish fast without skipping downstream impact.
  2. How to use deferred state to avoid rebuilding an entire project on every commit.
  3. Where to enforce tests (CI vs. production) and how to fail builds on error.
  4. How to promote code from a feature branch through staging to production without manual SQL copy-paste.
  5. How to handle breaking changes in shared models when multiple teams work in the same dbt project.
  6. How manifest.json enables diffing between two git refs to detect what changed.

How do you structure a dbt deployment pipeline?

A common pattern is a CI stage that runs on every PR and a separate deployment stage that runs on merge to main. The CI stage parses the project, runs dbt build --select state:modified+ against a ephemeral schema, and reports failures back to the pull request. The deployment stage runs the full dbt build against production on a schedule or on merge, using a production target and a production schema. The key decision is whether you clone the production database for CI (cheap to create, since a zero-copy clone initially shares storage with production; storage costs grow as CI rebuilds and modifies tables. This feature is Snowflake-style and not available the same way on every warehouse) or create isolated schemas per PR (simpler, but slower for large projects).

Strong candidates can explain the tradeoff between speed and isolation, how to keep CI artifacts fresh, and why running dbt test in production is sometimes necessary even when CI already ran tests.

Key facts

  • Tarmac's dbt interview questions cover 10 questions at difficulty 1–5 of 5.
  • Tarmac tracked 208 job postings asking for dbt in November 2026.
  • Roles asking for dbt advertise a median base salary of £80,000, across 109 job postings as of November 2026.
  • Tarmac last reviewed these dbt interview questions on 3 December 2026.

At a glance

Questions10
Difficulty1–5 of 5
FormatsMultiple choice, Multiple answer, True / false, Short answer

What you'll review

  1. ci cd dbt
  2. state deferral

Practice questions

Try one before you open the answer. Pick an option and press Check; it's marked on the spot.

In a typical dbt CI/CD pipeline, which single command runs models, tests, seeds, and snapshots in dependency order in one invocation?#

Options

Show answer

dbt build is the command that runs seeds, models, snapshots, and tests in dependency order in a single invocation, making it a common choice for dbt CI/CD pipelines. By contrast, dbt run executes only models, dbt test executes only tests, and dbt compile only generates compiled SQL without running anything.

Why:

dbt build is the one command that runs seeds, models, snapshots, and tests in a single dependency-aware pass, which is why it is commonly used in CI/CD jobs. dbt run only executes models, dbt test only executes tests, and dbt compile only generates compiled SQL without executing anything.

Which of the following are valid strategies for reducing CI run time in dbt pipelines (slim CI)? Select all that apply.#

Options

Pick every one that applies.

Show answer

Slim CI in dbt reduces pipeline time by running only changed models and their downstream dependents via --select state:modified+, supplying a previously generated manifest.json through the --state flag, and using --defer with --state so unselected parent models reference existing production relations instead of being rebuilt. Using --full-refresh on every model increases CI cost rather than reducing it.

Why:

Slim CI relies on dbt's state comparison: --state points to a prior manifest.json, state:modified+ selects only changed models plus downstream dependents, and --defer lets the CI run reference the deferred state's existing relations for unselected parents — all three reduce redundant work. --full-refresh forces every incremental model to rebuild from scratch, which increases cost and wall-clock time, so it is not a slim-CI strategy.

Which of the following statements about dbt's state comparison features for CI are true? Select all that apply.#

Options

Pick every one that applies.

Show answer

The true statements are: --state takes a directory path containing manifest.json, state:modified+ selects changed models plus their downstream children, and --defer with --state resolves unselected parents from the state manifest's relations. dbt reads the saved artifact from local disk, so --state does not need a live production database connection to fetch the manifest at runtime.

Why:

dbt's --state flag takes a path to a directory holding a previously generated manifest.json artifact; dbt looks for the file inside that directory, so pointing it at the file itself is not how it works. No live database connection is needed, because the manifest is read from local disk, which makes the claim about requiring a live production connection false. The state:modified+ selector compares the current project against that manifest and selects changed nodes together with all their downstream descendants. --defer with --state lets a CI run resolve parents that were not selected to the relations recorded in the deferred state, avoiding rebuilds of upstream models. So the true statements are the directory-path description, the state:modified+ description, and the --defer description.

In a dbt CI pipeline, you run dbt build --select state:modified+ --state ./target-prev to test only what changed on a pull request. Which of the following statements about this command and the state-based selection are TRUE?#

Options

Pick every one that applies.

Show answer

The correct statements are: state:modified+ selects changed resources plus their downstream dependents; state:modified alone selects only the changed resources; and --state must point to a directory containing a manifest.json typically from the main branch. The suffix + adds downstream children, not upstream parents, so claiming it includes upstream models is false.

Why:

state:modified+ compares each resource against the manifest at the --state path and selects those that differ, then the + suffix adds all downstream dependents — so the statement that it selects resources that differ from the comparison manifest plus all of their downstream dependents is true. Without the +, state:modified selects only the changed resources themselves with nothing downstream — so the statement that it selects only the directly modified resources and excludes downstream models is true. The --state flag must reference a directory containing a manifest.json (usually produced by a prior run on the main branch) — so the statement that it must point to a directory containing a manifest.json artifact, typically generated from the main/production branch, is true. The + suffix adds downstream (child) models, not upstream parents; selecting upstream would require a prefix + (e.g., +state:modified), so the claim that state:modified+ automatically includes upstream parent models of the modified resources so that they are also rebuilt during CI is false.

In a dbt CI pipeline, running dbt build --select state:modified+ --state ./prod-target --defer will: (1) select only the models that have changed relative to the production manifest, plus all of their downstream dependents; (2) resolve references to unchanged upstream models from the production state manifest instead of materializing those upstream models in the CI schema; and (3) execute both the selected models and their associated tests in a single invocation.#

Options

Show answer

True. The state:modified+ selector (with --state) picks changed models and their downstream dependents; --defer resolves unchanged upstream model relations from the production state manifest instead of rebuilding them in CI; and dbt build runs the selected models and their tests in a single invocation. This is the standard dbt slim-CI workflow.

Why:

All three claims are correct for dbt-core 1.x. The state:modified+ selector compares the current manifest against the state manifest (provided via --state) and selects resources whose definition has changed plus their downstream children (+). The --defer flag tells dbt to resolve relations for upstream models that are NOT in the current selection from the state manifest, so those upstream tables are read from the production schema rather than being rebuilt in CI. dbt build is a single command that runs models, tests, snapshots, and seeds together, so it executes the selected models and their tests in one invocation. This is the canonical dbt 'slim CI' pattern.

In a dbt CI pipeline, dbt build is functionally equivalent to running dbt run followed by dbt test, because dbt build first materializes all selected models and then runs all tests afterward — meaning a test failure on an upstream model does not prevent downstream models from executing.#

Options

Show answer

False. dbt build interleaves building and testing — it runs each model's tests immediately after materializing that model, and if a test fails, downstream dependents are skipped. Running dbt run then dbt test materializes all models first regardless of test outcomes, then tests separately. The interleaved failure-propagation behavior is a key reason dbt build is preferred in CI.

Why:

dbt build is NOT equivalent to dbt run followed by dbt test. dbt build interleaves model execution and testing: it builds a model and immediately runs that model's tests before proceeding to downstream models. If a test fails for a given model, dbt marks that model's status as failed and will skip downstream models that depend on it (the default indirect selection behavior). In contrast, dbt run followed by dbt test builds every model first regardless of test outcomes, then runs tests separately — so a test failure has no effect on whether downstream models were already materialized. This interleaved test-then-propagate behavior is one of the primary reasons dbt build is preferred in CI pipelines.

When using dbt's state:modified selector for slim CI, dbt compares only the compiled SQL of each model against the production state manifest to determine which models have changed. Changes to a model's configuration (e.g., materialization type, tags, meta), its schema tests, or the macros it depends on are not detected as modifications.#

Options

Show answer

False. dbt's state:modified selector compares the full node representation against the state manifest — not just compiled SQL. Changes to a model's configuration (materialization, tags, meta), schema test definitions, and referenced macro definitions are all detected as modifications, which is why slim CI catches config-only and test-only changes in addition to SQL edits.

Why:

The state:modified selector does not limit its comparison to compiled SQL alone. dbt computes a node's modification status by comparing the full node representation in the current manifest against the state manifest, which includes the raw/compiled SQL, configuration fields (materialization, tags, meta, resource configs), schema test definitions, and the set of macros referenced by the node. If any of these attributes differ between the two manifests, the node is flagged as modified. Additionally, changes to a macro's definition will mark all models that depend on that macro as modified. This broad comparison is what makes state-based slim CI effective: it catches config-only or test-only changes that would not be visible if only SQL were compared.

In a CI pipeline, how do state:modified selection and --defer let you test only the models you changed without rebuilding the entire project ('slim CI')?#

Show answer

dbt writes a manifest.json artifact describing every node and its compiled SQL. By saving the production manifest as a baseline, CI can run with --select state:modified (comparing against that baseline via --state path/to/prod/manifest), which selects only the nodes that changed plus, with the + operator, their downstream children. That builds just the affected slice instead of the whole DAG. The catch is that a changed model usually refs unchanged upstream models that don't exist in the CI schema. --defer solves that: for any ref to a node not selected for the current run, dbt resolves the relation to the deferred environment (production) instead of the empty CI schema, so the modified models read real upstream prod tables without you having to build them. Together they make CI fast and cheap — build and test only the diff, defer everything else to prod — which is the standard slim-CI pattern.

Why:

Slim CI rests on two features. State comparison: dbt's manifest.json is a full description of the project, so saving the production manifest as a baseline lets --select state:modified --state <prod-manifest> pick out only nodes whose definition changed (and, with +, their downstream dependents) — you build the diff, not the whole project. Deferral: a changed model still refs unchanged upstream models that were never built in the ephemeral CI schema; --defer makes those refs resolve to the production relations instead, so the modified models can read real upstream data without rebuilding it. Together they cut CI time and warehouse cost dramatically. A strong answer names the manifest baseline, state:modified, and how --defer redirects unbuilt refs to prod.

In a dbt CI pipeline (dbt v1.7+) running dbt build --select state:modified+ --defer-state ./prod-state/, tests defined on unselected upstream models are still executed during the CI run, because dbt build resolves and validates the full dependency graph including deferred resources.#

Options

Show answer

Tests on unselected upstream models do not run in that CI command. dbt build --select state:modified+ builds and tests only the modified nodes and their downstream children. --defer-state tells dbt where to find production relations for unselected parents, so the full graph is used to resolve those relations, not to expand the set of tests.

Why:

This statement is false. dbt build --select state:modified+ selects only the nodes flagged as modified relative to the production manifest plus their downstream dependents. The --defer-state flag serves a single purpose: relation resolution. When a selected model references an unselected parent, dbt resolves that parent's database relation from the deferred production manifest so the model can query the production table/view — but dbt does not build, test, or otherwise act on those unselected upstream nodes. Tests run only on the nodes that were actually selected and built. The full dependency graph is consulted for ordering and relation resolution, not to expand the set of tests executed. This is a common misconception: practitioners assume that because the entire DAG is known and the parent relations are resolvable, tests on those parents also run. They do not. Only explicitly selected resources (and their downstream + children) have their tests executed during the CI build.

Related interview questions

Job market

See dbt salaries and hiring demand from live job postings.

Practise these until they stick

That's every question we hold on this topic, and the page marks what you pick. What it can't do is remember. A free account keeps every answer, and what you miss comes back until it's right: after a day, then at longer gaps.

Start with this topic

Free · the whole bank · 100 answers per 30 days, each marked with written feedback

Interview booked? Practise the job ad instead

What moved, monthly

One email a month when the bulletin comes out: what moved in the markets we track, and the new question topics we published. Confirm your address to join. Unsubscribe any time.