Reconcile Internal Ledger Against a Partner Bank Settlement File

Last updated: November 29, 2026

Quick Overview

Given internal ledger entries and a partner bank settlement file (each row has a reference, amount in cents, and day), classify every row as matched, amount mismatch, missing in bank, missing in ledger, or fuzzy matched when the bank dropped the reference but amount and date line up.

Onepay
Coding & Algorithms
Software Engineer
Onepay
November 29, 2026
Software Engineer
Onsite
Coding & Algorithms
Medium

0

0

0 solved


Given internal ledger entries and a partner bank settlement file (each row has a reference, amount in cents, and day), classify every row as matched, amount mismatch, missing in bank, missing in ledger, or fuzzy matched when the bank dropped the reference but amount and date line up.

OnePay accounts are held at partner banks, so every day the internal ledger has to agree with what the bank says settled. This onsite coding question checks that you design a clear multi-pass match, keep fuzzy matching one-to-one, and produce output an operations team can act on.

What the Interviewer Expects
  • Exact reference match first, then a constrained fuzzy pass
  • Fuzzy matching is one-to-one and prefers the closest date
  • Amount mismatches are reported, never silently accepted
  • Every input row ends up in exactly one bucket
  • Discuss when fuzzy matches should go to human review instead of auto-clearing
Key Topics to Cover
reconciliation
hash joins
greedy matching
data quality
operations reporting
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
  • What if one ledger entry settles as two bank rows (split settlement)?
  • The file has 50 million rows. How do you run this without loading everything into memory?
  • How would you make the job safe to re-run when the bank sends a corrected file?
  • Which buckets should page someone and which should just open a ticket?
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 are two lists of {ref, amount, day}. Bank rows may have ref set to None. Output five buckets. A ledger entry and bank row with the same ref match if amounts agree, otherwise they are an amo...

High-Level Design

Pass 1 is a hash join on ref, which handles the vast majority of rows. Pass 2 groups leftover bank rows by amount, then for each leftover ledger entry (processed in date order for determinism) picks t...


Submit Your Answer
Markdown supported

Related Questions