Reconcile Bank Ledger Entries Against Card Processor Settlements

Last updated: November 29, 2026

Quick Overview

Given bank ledger entries and processor settlement records, each with an id, a reference, an amount in cents and a date, match each bank entry to at most one settlement with the same reference and amount within a 2-day window, and report the matched pairs plus the unmatched entries on each side.

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

0

0

0 solved


Given bank ledger entries and processor settlement records, each with an id, a reference, an amount in cents and a date, match each bank entry to at most one settlement with the same reference and amount within a 2-day window, and report the matched pairs plus the unmatched entries on each side.

Treasury and merchant services teams at Wells Fargo reconcile internal ledgers against external files every day, and breaks drive exception queues that operations staff work by hand. The interviewer checks hashing for grouping, one-to-one matching with duplicates, and clean handling of timing differences.

What the Interviewer Expects
  • Group candidates by (reference, amount) with a hash map instead of an O(n*m) scan
  • Enforce one-to-one matching so duplicate payments are not both matched to one settlement
  • Choose the closest date within tolerance deterministically
  • Use integer cents, never floats
  • Return both sides' unmatched items for the exception queue
Key Topics to Cover
Hash maps
Matching
Sorting
Money as integers
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
  • Greedy nearest-date matching is not always globally optimal. When does it fail and how would you fix it?
  • How would you support partial matches such as one settlement covering three ledger entries?
  • The files are 50 million rows each. How would you run this in Spark?
  • How do you make a rerun produce the same matches?
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

Match key is exact (reference, amount_cents). Dates may differ by settlement lag up to day_tol days. Each record is used at most once. Output: list of (bank_id, proc_id) pairs, unmatched bank ids, u...

High-Level Design

Build a dict from (reference, amount) to the processor rows with that key, sorted by date. Walk bank rows in date order; for each, pick the unused processor row with the smallest date gap inside toler...


Submit Your Answer
Markdown supported

Related Questions