guides · intermediate



Payments in one page


Payment interviews test whether you can keep money correct under retries, delays, and partial failures — not whether you memorized API field names.


In plain English: Moving money is slow and messy. Your job is to design systems that never lose track of who owes what, even when networks fail or users double-click “Pay”.


SEPA basics

TermWhat it means
SCT (Credit Transfer)Payer pushes money to payee — usually batch, T+1 settlement windows.
SCT InstInstant scheme — seconds, with scheme limits and cutoffs.
Direct DebitPayee pulls with a signed mandate — different fraud and retry rules.
IBAN / BICRouting identifiers — validate format and country rules before calling bank rails.

Idempotency (must-know)

Clients retry POST requests on timeouts. Without an idempotency key, you may charge twice.

  1. Client sends Idempotency-Key header (UUID).
  2. Server stores key → response mapping for the retry window (often 24h).
  3. Duplicate key returns the same result without re-executing side effects.

Interview sound bite: “Idempotency makes retries safe; unique business references and DB constraints are the second line of defense.”

Ledger invariants

  • Double-entry: debits = credits per transaction.
  • Balances are derived from immutable entries — avoid updating a single “balance column” without an audit trail.
  • Pending → posted → settled are distinct states; do not conflate “API returned 200” with “money moved.”

Webhooks & async status

Banks and processors notify you asynchronously. Design for:

  • At-least-once delivery — handle duplicates with idempotent consumers.
  • Out-of-order events — use monotonic status transitions or version fields.
  • Signature verification — reject unsigned or replayed payloads.

Reconciliation

Nightly (or continuous) jobs match internal ledger rows to external bank/processor statements. Mismatches trigger ops alerts — this is where “paper perfect” systems prove themselves.

Story prompts for behavioral rounds

  • Describe a production payment incident and how you limited blast radius.
  • How you designed idempotency for a high-traffic checkout or transfer API.
  • Trade-off between strong consistency and availability during an outage.

Drill next

Read the SEPA lifecycle article, then complete Payments MCQ Bank 1 & 2. Aim to explain each wrong answer aloud in one sentence.

Track: Engineering Foundations

Previous: Java Interview Walkthrough

By Shubham Jain

All articles · Study paths

Shubham Jain · Learning Lab