Reconcile a General Ledger Against a Bank Statement Feed
Last updated: November 29, 2026
Quick Overview
Match internal ledger entries to bank statement lines with the same amount whose dates differ by at most k days, maximizing the number of matches, and report what is left unmatched on each side.
Bank of America
November 29, 20260
0
0 solved
Match internal ledger entries to bank statement lines with the same amount whose dates differ by at most k days, maximizing the number of matches, and report what is left unmatched on each side.
Grounded in CashPro and corporate treasury reconciliation, where clients compare their ERP ledger to BofA's statement data (BAI2 or camt.053) and value dates often slip by a day or two. The interviewer checks that you see the greedy two pointer argument per amount and can justify why it is optimal.
What the Interviewer Expects
- Bucket by exact amount in integer cents
- Sort each bucket by date and match greedily with two pointers
- Argue why earliest feasible matching maximizes matches
- Report unmatched items on both sides deterministically
- Discuss real-world keys beyond amount
Key Topics to Cover
How to Approach This
- Clarify input constraints and edge cases before writing code.
- Walk through your approach verbally and confirm with the interviewer before coding.
- Start with a brute force solution, then optimize. Mention time and space complexity.
- Test your solution with examples, including edge cases like empty input or duplicates.
- Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
- How would you match one bank line to several ledger lines that sum to it?
- How would you prefer the closest date when several candidates are feasible?
- How do reference fields like check number change the design?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
Ledger and bank entries are (id, date, cents). A pair can match if amounts are equal and . Each entry is used at most once. Maximize matches, return pairs plus unmatched ids from bo...
High-Level Design
Amounts must be equal, so the problem splits into independent buckets. Inside a bucket it is interval to point matching: each ledger entry accepts bank dates in . Sort both lists b...