Skip to content
LakeBench
ProblemsCommunityPricing
Sign inStart practicing
Back
  1. Home
  2. 45-Day Plan
  3. Day 33

Day 33 of 45 · Pro lesson

dbt Core & Modeling

The curriculum for this day stays visible. The lesson, code, and workspace unlock with Pro.

Teaches: dbt architecture & compilation to native SQL, Sources, staging models & column renaming, ref() DAG generation & lineage, Generic tests (not_null, unique, accepted_values, relationships), dbt macros & Jinja templating, SCD Type 2 snapshots (check vs timestamp strategy)

Build: dbt transformation engine: raw sources → staging clean views → dimensional fact mart with automated lineage graph compilation and snapshot history tracking.

  • •Complete 15 drills on dbt ref() lineage, source contracts, custom test macros, and snapshot invalidations.
  • •Run 6 Python modules simulating Jinja compilation, DAG topological sorting, and snapshot row mutation.
  • •Simulate 5 production failures: circular ref deadlock, schema drift break, snapshot timestamp drift, and failed uniqueness test.
  • •Defend 10 senior dbt analytics engineering questions and pass the blank-page challenge.

Never hardcode database or schema names in SQL. Always use {{ source() }} and {{ ref() }} to guarantee atomic DAG compilation and environment isolation.

This section walks through the idea with a short example, then the trade-offs you should mention in an interview.

In practice you start from the raw rows, apply the transform step by step, and check the shape of the result before you move on.

A common mistake is to jump straight to the final query without naming the grain or the join keys that keep the result correct.

Once the core path works, you harden it for nulls, duplicates, and late data so the pipeline stays reliable under load.

The Pro write-up covers the full explanation, worked examples, and the code you can run in the studio.

# Locked example
result = transform(frame)
print(result.head())

Sign in to continue with Pro

Sign in with a Pro account to open the full lesson and in-browser workspace.

Sign in

Already on Pro? Go to your account. Need a pass? See pricing.