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
Ensuring Accuracy in Financial Data
00:00
5 left

Ensuring Accuracy in Financial Data

MediumSQL · PostgreSQL

Problem

How do you ensure data accuracy when working with complex financial datasets?

Using the supplied January 2025 loan snapshots and payment transactions, write a SQL query that identifies records where the reported ending balance does not reconcile with the opening balance and principal payments.

Output

  1. One row per reconciliation issue.
  2. Return loan_id, snapshot_date, reported_ending_balance, calculated_ending_balance, discrepancy_amount, and accuracy_status.
  3. Include missing reported balances and discrepancies greater than $0.01. Order by loan_id.

Schema

loan_snapshots
ColumnTypeDescription
loan_idPKVARCHAR(20)Unique loan identifier
snapshot_dateDATEDate of the reported loan balance
opening_balanceNUMERIC(14,2)Balance at the start of the reporting period
reported_ending_balanceNUMERIC(14,2)Balance reported at the end of the period
payment_transactions
ColumnTypeDescription
payment_idPKVARCHAR(20)Unique payment identifier
loan_idVARCHAR(20)Loan associated with the payment
payment_dateDATEDate the payment was posted
principal_paidNUMERIC(14,2)Principal component of the payment
Tablesloan_snapshotspayment_transactions
Interviewer

Your question is Ensuring Accuracy in Financial Data. 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.