Preparing your design workspace

Loading the problem and your latest saved attempt…

Design In-Store Merchant Payment Reconciliation

Design a correct payment-recording and nightly reconciliation system for in-store merchants and their acquiring banks.

Problem statement

For this exercise, assume an in-store merchant such as a coffee shop accepts card-like payments at a point of sale rather than through an online checkout. A cashier submits an immutable charge amount, currency, merchant, location, and order reference with a stable idempotency key.

An external acquiring bank or processor may approve, decline, time out after acting, or later deliver duplicated and out-of-order bank-transaction updates.

The platform records the merchant charge and every external transaction observation, exposes one authoritative payment outcome, and produces a nightly reconciliation report for each acquiring bank.

A report must identify matched charges, merchant charges with no external match, external transactions with no merchant charge, duplicates, amount or currency mismatches, and still-unresolved outcomes without silently changing historical evidence.

For this exercise, assume peaks of 10,000 charge commands per second across 100,000 merchant locations, a 500 millisecond p95 durable command response excluding external completion, and completion of each healthy nightly report within two hours after its cutoff.

Financial records and report versions remain auditable for seven years. One logical sale must not be charged twice because of retries, one external transaction must not settle two merchant charges, and rerunning reconciliation must converge on the same versioned result for the same evidence cutoff.

Design charge APIs, durable records, acquiring-bank integrations, transaction ingestion, matching, partitioning, nightly cutoffs, report publication, exception handling, retries, recovery, and observability.

Refunds, chargebacks, tips, card-data storage, fraud-model design, merchant onboarding, and payout execution are outside scope.

What to build

  1. A point of sale can idempotently submit one in-store charge and converge on its sole authoritative payment outcome.
  2. The platform durably ingests duplicated, delayed, or corrected acquiring-bank transaction evidence without double counting it.
  3. The platform matches charges and external transactions at a defined nightly cutoff and classifies every mismatch or unresolved item explicitly.
  4. Authorized merchant and operations users can retrieve versioned per-acquirer reports, inspect evidence, and rerun or supersede a report without erasing prior results.

At scale

  • For this exercise, assume 100,000 merchant locations and peaks of 10,000 charge commands per second, with strong skew around meal periods and large merchants.
  • For this exercise, target a 500 millisecond p95 durable charge-command response, excluding asynchronous acquiring-bank completion.
  • For this exercise, complete each healthy nightly per-acquirer reconciliation report within two hours after its cutoff while preserving explicit unresolved items for late evidence.
  • For this exercise, retain immutable financial evidence and every published report version for seven years; external updates may be duplicated, reordered, or delayed beyond the first nightly cutoff.