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
ExperiencesCoaching
New
Practice
Mock InterviewsTimed interview simulations with feedbackSuccess 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
Get started
Track Conversion Defects by Batch
00:00
5 left

Track Conversion Defects by Batch

MediumSQL · PostgreSQL

Problem

You are given source records, converted records, and defect logs from a data conversion process tracked in Accenture myWizard. Write a PostgreSQL query that returns one row per conversion batch for batches completed in March 2024. For each batch, show the total source records, successfully converted records, records with data mismatches, open defects, and a batch status of Resolved or Needs Attention. A batch should be Needs Attention if it has at least one open defect or at least one mismatched record; otherwise mark it Resolved.

Schema

conversion_batches
ColumnTypeDescription
batch_idPKINTPrimary key for the conversion batch
batch_nameVARCHAR(100)Human-readable batch name
completed_dateDATEDate the conversion batch was completed
source_records
ColumnTypeDescription
source_idPKINTPrimary key for the source record
batch_idINTBatch to which the source record belongs
source_amountNUMERIC(10,2)Amount in the source system
converted_records
ColumnTypeDescription
converted_idPKINTPrimary key for the converted record
source_idINTSource record that was converted
converted_amountNUMERIC(10,2)Amount after conversion
conversion_statusVARCHAR(20)Status of the conversion attempt
defect_log
ColumnTypeDescription
defect_idPKINTPrimary key for the defect
batch_idINTBatch associated with the defect
defect_typeVARCHAR(30)Type of defect found during validation
defect_statusVARCHAR(20)Current status of the defect
Tablesconversion_batchessource_recordsconverted_recordsdefect_log
Interviewer

Your question is Track Conversion Defects by Batch. Start with the requirements and the four 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.