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
Validating Data Integrity Across Regions
00:00
5 left

Validating Data Integrity Across Regions

MediumSQL · PostgreSQL

Problem

How do you validate data integrity when dealing with large, messy datasets from multiple regional databases for Uber?

For this SQL exercise, use the supplied canonical trip data, regional records, and region reference data to identify integrity issues. Return one validation result per trip identifier, including records that appear only in a regional database.

Output

  1. One row per distinct trip identifier
  2. Include canonical and regional values, regional record count, and an issue_flags classification
  3. Order by trip_id ascending

Schema

canonical_trips
ColumnTypeDescription
trip_idPKVARCHAR(20)Canonical Uber trip identifier
region_codeVARCHAR(5)Canonical operating region
fare_amountDECIMAL(10,2)Canonical trip fare
statusVARCHAR(20)Canonical trip status
regional_trip_records
ColumnTypeDescription
regional_record_idPKINTRegional source record identifier
trip_idVARCHAR(20)Trip identifier received from a regional database
region_codeVARCHAR(5)Region reported by the regional source
fare_amountDECIMAL(10,2)Fare reported by the regional source
statusVARCHAR(20)Trip status reported by the regional source
region_codes
ColumnTypeDescription
region_codePKVARCHAR(5)Approved region code
region_nameVARCHAR(100)Region display name
Tablescanonical_tripsregional_trip_recordsregion_codes
Interviewer

Your question is Validating Data Integrity Across Regions. 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.