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
Complex Joins for Reconciliation
00:00
5 left

Complex Joins for Reconciliation

HardSQL · PostgreSQL

Problem

Describe a situation where you had to perform a complex JOIN to reconcile disparate data sources.

Use the provided transaction mapping and source-system records to produce a reconciliation report. Include matched records, amount discrepancies, and records missing from either source.

Output

  1. One row per reconciled or unmatched transaction reference.
  2. Columns: canonical_id, source_a_ref, source_b_ref, source_a_total, source_b_total, amount_difference, and reconciliation_status.
  3. Include matched, mismatched, and source-missing records. Sort by canonical_id ascending with unmatched canonical IDs last, then by source references.

Schema

transaction_mapping
ColumnTypeDescription
canonical_idPKINTShared identifier used to reconcile records
source_a_refVARCHAR(20)Reference used by Source A
source_b_refVARCHAR(20)Reference used by Source B
source_a_records
ColumnTypeDescription
record_idPKINTSource A record identifier
source_refVARCHAR(20)Reference from Source A
record_dateDATEDate recorded by Source A
amountNUMERIC(12,2)Amount reported by Source A
source_b_records
ColumnTypeDescription
record_idPKINTSource B record identifier
source_refVARCHAR(20)Reference from Source B
record_dateDATEDate recorded by Source B
amountNUMERIC(12,2)Amount reported by Source B
Tablestransaction_mappingsource_a_recordssource_b_records
Interviewer

Your question is Complex Joins for Reconciliation. 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.