Dataford
Interview QuestionsInterview GuidesExperiencesCoaching
New
Pricing
Get started
Dataford
Popular roles
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Browse
Browse All RolesEvery role hub, from analyst to MLBrowse All CompaniesCompany-specific interview loopsAll Interview GuidesThe full guide library
Top questions by role
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Top questions by skill
SQLPythonStatisticsMachine LearningA/B TestingSystem DesignGenerative AIProduct SenseMetricsBehavioral
Browse all questions →Try a mock interview
Experiences
Practice
Mock InterviewsTimed interview simulations with feedbackCoaching1:1 coaching with people at your target companiesSuccess PathYour 6-week structured planModulesCurated lessons by topicWebinarsTalks from ex-Big Tech data leadsPlaygroundA free-form scratch editor
Learn
BlogInterview strategy and career adviceTech Job Market ReportHiring trends across data and AI rolesFor UniversitiesDataford for career centersAbout DatafordWho we are and how we build
Pricing
Build my plan
Snowflake and dbt Experience
00:00
5 left

Snowflake and dbt Experience

MediumSQL · PostgreSQL

Problem

Questions about Snowflake and dbt.

Write a PostgreSQL-compatible query against dbt-style model and run metadata. Return the latest run for every active model, or indicate that the model has never run. If the latest run has no failed-test count, report zero.

Output

  1. One row per active model with model_name, materialization, latest_status, latest_started_at, and failed_tests
  2. Include active models without a run
  3. Sort by model_name ascending

Schema

dbt_models
ColumnTypeDescription
model_idPKINTUnique dbt model identifier
model_nameVARCHAR(150)dbt model name
materializationVARCHAR(30)dbt materialization type
is_activeBOOLEANWhether the model is currently active
dbt_model_runs
ColumnTypeDescription
run_idPKINTUnique model run identifier
model_idINTReferenced dbt model
statusVARCHAR(30)Run status
started_atTIMESTAMPRun start timestamp
failed_testsINTNumber of failed tests for the run
Tablesdbt_modelsdbt_model_runs
Interviewer

Your question is Snowflake and dbt Experience. Start with the requirements and the two tables in the Question tab.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.
CodePostgreSQL
Sign up free to run your codeLog inLn 1
Run your query to see results here.