Payment System
Difficulty: Hard
What It Tests
Financial consistency, idempotency, reconciliation, audit trail, compliance.
Topics Covered
- Distributed Transactions & Idempotency
- Database Design: SQL vs NoSQL
- Message Queues & Async Processing
- Rate Limiting
- CAP Theorem & Consistency Models
- Database Replication
- Microservices & API Gateway
Hello Interview Breakdown
Read the full Hello Interview breakdown →
Approach Hints
- Every payment request carries an idempotency key; the server stores (key → result) to make retries safe even if the network fails mid-flight
- Double-entry accounting: every transaction creates both a debit and a credit entry; balances are always derived from the ledger, never stored directly
- Use Saga orchestration to coordinate across payment processor, ledger service, and notification service — each step has a compensating action for rollback
- Append-only ledger table for complete audit trail; nightly reconciliation job compares ledger totals against payment processor reports to catch discrepancies