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
Handling Missing or Inconsistent Data
00:00
5 left

Handling Missing or Inconsistent Data

HardSQL · PostgreSQL

Problem

How do you handle missing or inconsistent data when preparing a report for finance teams?

Using the invoices, customers, and exchange_rates tables, write a SQL query that produces a monthly data-quality reconciliation for January through March 2025.

Output

  1. One row per calendar month, ordered chronologically.
  2. Columns: report_month, invoice_count, accepted_invoice_count, missing_customer_count, missing_rate_count, invalid_amount_count, invalid_status_count, and accepted_amount_usd.
  3. Exclude invoices outside the date range. Treat positive amounts and statuses normalized to posted or paid as valid. Include only invoices with a matching customer, exchange rate, valid amount, and valid status in accepted counts and USD totals.

Schema

invoices
ColumnTypeDescription
invoice_idPKINTUnique invoice identifier
invoice_dateDATEInvoice issue date
customer_idINTCustomer associated with the invoice
amountNUMERIC(14,2)Invoice amount in the invoice currency
currency_codeVARCHAR(20)Invoice currency code
statusVARCHAR(40)Invoice processing status
customers
ColumnTypeDescription
customer_idPKINTUnique customer identifier
customer_nameVARCHAR(120)Customer legal name
regionVARCHAR(60)Customer sales region
exchange_rates
ColumnTypeDescription
currency_codePKVARCHAR(20)Currency converted to USD
rate_datePKDATEFirst day of the applicable month
usd_rateNUMERIC(14,6)USD conversion rate
Tablesinvoicescustomersexchange_rates
Interviewer

Your question is Handling Missing or Inconsistent Data. 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.