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
SQL Joins and De-duplication
00:00
5 left

SQL Joins and De-duplication

MediumSQL · PostgreSQL

Problem

Explain how you would use SQL joins and de-duplication techniques to clean and validate data for QA testing.

Use the provided source records and account reference data. Return the latest source record for each normalized email, identify duplicate source records, and expose records that are unmatched or inconsistent.

Output

  1. One row per normalized email across either dataset
  2. Columns: normalized_email, source_id, full_name, source_status, account_id, account_name, account_status, duplicate_count, and validation_status
  3. Include source-only and reference-only records, and sort by normalized_email ascending with NULL last

Schema

qa_source_records
ColumnTypeDescription
source_idPKINTUnique identifier for the incoming source record
emailVARCHAR(255)Email value received from the source system
full_nameVARCHAR(150)Name received from the source system
account_statusVARCHAR(20)Account status received from the source system
updated_atTIMESTAMPSource record update timestamp
qa_accounts
ColumnTypeDescription
account_idPKINTReference account identifier
normalized_emailVARCHAR(255)Canonical lowercase and trimmed email
account_nameVARCHAR(150)Reference account name
account_statusVARCHAR(20)Reference account status
Tablesqa_source_recordsqa_accounts
Interviewer

Your question is SQL Joins and De-duplication. 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.