Reconcile Daily Payout Ledger Entries Against Bank Settlement Files
Last updated: November 29, 2026
Quick Overview
Given ledger entries on a payout clearing account and the rows parsed from a partner bank's daily settlement file, write SQL that lists every transfer that is missing on either side, settled twice, or settled for a different amount on a given day.
Bridge
November 29, 20260
0
0 solved
Given ledger entries on a payout clearing account and the rows parsed from a partner bank's daily settlement file, write SQL that lists every transfer that is missing on either side, settled twice, or settled for a different amount on a given day.
Bridge moves fiat through partner banks, and every morning someone has to prove that what the ledger says left matches what the bank says settled. This screen checks precise SQL over messy financial data: aggregation before joining, full outer joins, and classifying breaks so operations can act on them.
What the Interviewer Expects
- Aggregate each side to one row per transfer and currency before joining
- Use a FULL OUTER JOIN so breaks on both sides appear
- Handle signed amounts or debit and credit directions consistently
- Classify each break into an actionable category
- Explain cut-off and timezone issues that create false breaks
Key Topics to Cover
How to Approach This
- Clarify the schema and expected output format before writing queries.
- Use CTEs (WITH clauses) to break complex queries into readable steps.
- Consider window functions (ROW_NUMBER, RANK, LAG, LEAD) for ranking and sequential analysis.
- Watch for NULLs, duplicates, and edge cases in JOINs and GROUP BY.
- For pandas, prefer vectorized operations over row-by-row iteration.
Possible Follow-up Questions
- How would you handle a transfer that the ledger books on the 27th but the bank settles on the 28th?
- How would you make this incremental instead of recomputing every day?
- Banks sometimes net many transfers into one settlement line. How does the query change?
- How would you track how long each break stays open?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice SQL ProblemsSample Answer
Clarify the Data
ledger_entries(transfer_id, account, currency, amount_minor, entry_date): integer minor units, positive for money leaving through the clearing account. `bank_settlements(transfer_id, currency, amoun...
Approach
Join at the grain of (transfer_id, currency) after aggregating, otherwise a transfer with two ledger legs and one bank row fans out and doubles amounts. Restrict ledger rows to the clearing account so...