You are starting a dbt project over Shopify and Stripe data. Walk me through the folder structure and say what each layer is allowed to do.
Why they ask this
It is the most common open-ended dbt question and about a third of interviews contain some version of it. The interviewer is checking that you have a structure with reasons behind it rather than one you copied.
Say this
Three layers: staging with one view per source table doing only renaming and casting, intermediate for reusable joins and reshaping that no consumer queries directly, and marts as the tables the business reads, organised by business area rather than by source.
The reasoning
`models/staging/` gets one subfolder per source system and one model per source table, named `stg_shopify__orders`. These are views, they do renaming, casting, light cleaning and column selection, and they never join. The value is that everything downstream sees one consistently-named version of each table, and there is exactly one place to change when the vendor renames a column.
`models/intermediate/` holds the pieces that are not the final answer but are used by more than one thing: a join that reassembles an entity from three staged tables, a deduplication step, a fan-out resolved before it can do damage. Name them `int_<entity>_<verb>`, like `int_orders_joined_to_payments`. Nobody outside dbt should query these, and if only one mart uses one, it probably belongs inside that mart.
`models/marts/` is organised by business domain — `finance/`, `marketing/` — not by source, because that is how consumers think and because a mart usually spans sources. These are tables, they are the contract with the business, and they carry the tests and documentation that matter. `fct_` for event-grain facts, `dim_` for entities.
Alongside those: `models/staging/<source>/_sources.yml` declaring the sources next to the models that use them, `snapshots/` for SCD2, `seeds/` for version-controlled reference data, `macros/`, and `tests/` for singular tests. The convention I would defend hardest is one staging model per source table — it is what stops the same cleaning logic existing in four places with three different opinions.
The answer most people give
Organising marts by source system — a `shopify/` folder and a `stripe/` folder. It works until the first mart that needs both, and then the folder is a lie and nobody knows where the next model goes.
They’ll ask next
Where would a model that only one mart uses go — intermediate, or inside the mart folder?
