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
Validate Bank Reconciliation Completeness
00:00
5 left

Validate Bank Reconciliation Completeness

HardSQL · PostgreSQL

Problem

You are given a bank reconciliation dataset with ledger entries, bank statement transactions, and reconciliation runs. Write a PostgreSQL query that validates whether each reconciliation run is complete and accurate by comparing ledger and bank transactions for the same account and statement period.

Return one row per reconciliation run with the total ledger amount, total bank amount, the variance between them, the count of unmatched ledger items, the count of unmatched bank items, and a status of complete only when both sides balance and there are no unmatched items.

Schema

reconciliation_runs
ColumnTypeDescription
reconciliation_run_idPKINTPrimary key for the reconciliation run
account_idINTAccount being reconciled
statement_start_dateDATEStart of the statement period
statement_end_dateDATEEnd of the statement period
run_dateDATEDate the reconciliation was performed
ledger_entries
ColumnTypeDescription
ledger_entry_idPKINTPrimary key for the ledger entry
account_idINTAccount associated with the entry
entry_dateDATELedger posting date
amountNUMERIC(12,2)Signed ledger amount
bank_referenceVARCHAR(50)Bank reference if matched; may be NULL
bank_transactions
ColumnTypeDescription
bank_transaction_idPKINTPrimary key for the bank transaction
account_idINTAccount associated with the transaction
transaction_dateDATEBank transaction date
amountNUMERIC(12,2)Signed bank amount
bank_referenceVARCHAR(50)Bank reference if matched; may be NULL
Tablesreconciliation_runsledger_entriesbank_transactions
Interviewer

Your question is Validate Bank Reconciliation Completeness. 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.