System Design Prompt
Design a card payment processing system similar to a Visa/Mastercard network.
The system should support:
-
Card-present and card-not-present transactions
-
Authorization (approve/decline), capture/settlement, refunds, and reversals
-
High availability and low latency for authorization
-
Exactly-once/at-most-once semantics where appropriate (no double-charging)
-
Idempotency and retries across unreliable networks
-
Auditability, reconciliation, and dispute/chargeback workflows (high level)
-
Compliance considerations (PCI, encryption, key management)
What to cover
-
Requirements (functional + non-functional) and assumptions
-
High-level architecture and core services
-
APIs/events and data models (high level)
-
Consistency, idempotency, ordering, and failure handling
-
Storage choices, scaling, partitioning
-
Observability, security, fraud hooks
-
Capacity estimates (rough) and bottlenecks