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
Schema Evolution in Warehouses
00:00
5 left

Schema Evolution in Warehouses

MediumSQL · PostgreSQL

Problem

Explain your process for handling schema evolution in a long-term data warehouse environment.

Write a PostgreSQL query that reports the latest deployed schema version for every warehouse table and identifies unresolved breaking changes. Schema versions with a NULL deployed_at must be ignored.

Output

  1. One row per warehouse table, including tables without a deployed version
  2. Columns: table_name, version_number, deployed_at, open_breaking_changes, and schema_status
  3. Use NEVER_DEPLOYED when no deployed version exists, NEEDS_REVIEW when the latest deployed version has unresolved breaking changes, otherwise STABLE
  4. Order by table_name ascending

Schema

warehouse_tables
ColumnTypeDescription
table_idPKINTEGERWarehouse table identifier
table_nameVARCHAR(80)Warehouse table name
schema_versions
ColumnTypeDescription
version_idPKINTEGERSchema version identifier
table_idINTEGERReferenced warehouse table
version_numberINTEGERSequential schema version number
deployed_atDATEDate the version was deployed; NULL means not deployed
column_changes
ColumnTypeDescription
change_idPKINTEGERColumn change identifier
table_idINTEGERAffected warehouse table
version_idINTEGERSchema version containing the change
change_typeVARCHAR(40)Type of column change
is_breakingBOOLEANWhether the change can break consumers
resolved_atDATEDate the issue was resolved
change_descriptionVARCHAR(200)Short description of the change
Tableswarehouse_tablesschema_versionscolumn_changes
Interviewer

Your question is Schema Evolution in Warehouses. Start with the requirements and the three 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.