Reconcile Bank Statement Lines to Ledger Cash Entries

Last updated: November 29, 2026

Quick Overview

Match each bank statement transaction to an unmatched ledger cash entry with the same amount whose date is within a tolerance of a few days, preferring the closest date, and return the matches plus unmatched items on both sides.

EY
Coding & Algorithms
Software Engineer
EY
November 29, 2026
Software Engineer
Technical Screen
Coding & Algorithms
Medium

0

0

0 solved


Match each bank statement transaction to an unmatched ledger cash entry with the same amount whose date is within a tolerance of a few days, preferring the closest date, and return the matches plus unmatched items on both sides.

Bank reconciliation is a core control that EY teams test and automate for clients in assurance and finance transformation work. The interviewer checks that you index by the right key, handle one-to-one matching correctly and reason about greedy choices and timing differences.

What the Interviewer Expects
  • Index ledger entries by amount, then by date
  • Enforce one-to-one matching with a used set
  • Pick the closest date within tolerance and break ties deterministically
  • Return unmatched bank and ledger items, since those drive the reconciliation
  • Discuss when greedy matching can be suboptimal
Key Topics to Cover
hashing
binary search
greedy matching
reconciliation
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
  • How would you support one bank line matching several ledger lines that sum to it?
  • When could greedy by bank date produce fewer matches than optimal, and how would you fix it?
  • How would you handle amounts in cents versus strings with currency symbols?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice DSA Problems
Sample Answer
Requirements

Inputs: bank lines and ledger lines, each (id, date, amount_cents). A match needs equal amounts and |date difference| <= tolerance_days. Each ledger entry can be used once. Output matches, unmatch...

High-Level Design

Group ledger entries by amount and sort each group by date. Process bank lines in date order; for each, binary search its amount group for the first ledger date at or after date - tolerance, scan fo...


Submit Your Answer
Markdown supported

Related Questions