Question
Design a payment platform with two operations: - `hold` synchronously requests authorization from a downstream card network and must return approval or rejection within a 500 ms p95 target. - `charge` references an approved hold, durably records the request, acknowledges it, and includes it in a later settlement batch. Assume 10 million holds and 8 million charges per day, peaks near 300 requests per second, 5–10 downstream networks, a two-hour nightly settlement window, and a seven-day hold lifetime. Explain idempotency for both operations, hold expiration, retries, late events, settlement cutoffs, reconciliation, failure recovery, and the path from approved transactions to partitioned settlement files. ## Follow-ups 1. Add partial capture and partial refund semantics. 2. Reconcile a network response that arrives after the synchronous timeout. 3. Describe how an operator safely replays one failed settlement partition.