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
Cleaning and Transforming Disparate Data
00:00
5 left

Cleaning and Transforming Disparate Data

HardSQL · PostgreSQL

Problem

How do you handle data cleaning and transformation when working with disparate sources like Workday or internal databases?

Write a SQL query that standardizes employee records from Workday and an internal HR database, then returns one reconciled row per employee. Treat blank strings as missing values, normalize department names to a single canonical value, and prefer the most recent non-null hire date when both sources disagree.

Output

  1. One row per employee_id
  2. Columns: employee_id, full_name, canonical_department, hire_date, source_status
  3. Include employees present in either source
  4. Sort by employee_id

Schema

workday_employees
ColumnTypeDescription
employee_idPKINTWorkday employee identifier
full_nameVARCHAR(255)Employee full name as stored in Workday
departmentVARCHAR(255)Department name in Workday
hire_dateDATEHire date in Workday
internal_employees
ColumnTypeDescription
employee_idPKINTInternal employee identifier
full_nameVARCHAR(255)Employee full name as stored internally
departmentVARCHAR(255)Department name in the internal system
hire_dateDATEHire date in the internal system
Tablesworkday_employeesinternal_employees
Interviewer

Your question is Cleaning and Transforming Disparate Data. 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.