Reconcile a Partner Bank Settlement File Against the Internal Ledger

Last updated: November 29, 2026

Quick Overview

Write a Python function that compares the internal ledger's transactions for a day with the partner bank's settlement file, both keyed by transaction id with amounts in cents. Report matched records, amount mismatches, records missing on either side, and duplicate ids within each source.

Chime
Data Manipulation (SQL/Python)
Data Engineer
Chime
November 29, 2026
Data Engineer
Technical Screen
Data Manipulation (SQL/Python)
Easy

0

0

0 solved


Write a Python function that compares the internal ledger's transactions for a day with the partner bank's settlement file, both keyed by transaction id with amounts in cents. Report matched records, amount mismatches, records missing on either side, and duplicate ids within each source.

A data engineering screen in the style of Chime, which holds member funds at partner banks and must prove every day that its own books agree with theirs. The interviewer checks clean set logic, deterministic output for an ops queue, and attention to duplicates, which are the breaks most often missed.

What the Interviewer Expects
  • Clarify the matching key and amount units
  • Detect duplicates before building lookup maps
  • Classify every id into exactly one break type
  • Produce sorted, deterministic output
  • Explain how this scales to a daily batch job
Key Topics to Cover
Reconciliation
Set Operations
Deduplication
Data Quality
Batch Pipelines
How to Approach This
  1. Clarify the schema and expected output format before writing queries.
  2. Use CTEs (WITH clauses) to break complex queries into readable steps.
  3. Consider window functions (ROW_NUMBER, RANK, LAG, LEAD) for ranking and sequential analysis.
  4. Watch for NULLs, duplicates, and edge cases in JOINs and GROUP BY.
  5. For pandas, prefer vectorized operations over row-by-row iteration.
Possible Follow-up Questions
  • Some bank rows have no transaction id. How would you match them?
  • How would you run this on 50 million rows a day?
  • Which breaks should auto-resolve the next day and which should page someone?
Sharpen Your Skills on Codemia

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

Practice SQL Problems
Sample Answer
Clarify the Data

Each source is a list of dicts with txn_id and amount_cents (integers, same sign convention). A txn_id should appear once per source; repeats are themselves a break. Output buckets: matched, `...

Approach

Count ids per source with Counter to find duplicates. Build id -> amount maps (for duplicates the last value wins, but they are already flagged). Walk the sorted union of ids and classify each int...


Submit Your Answer
Markdown supported

Related Questions