For an SRE interview, think of an RTP (Real-Time Payments) system as a highly available distributed system where a payment must move through multiple services within seconds without being duplicated or lost.
End-to-end RTP payment flow
Suppose A sends ₹10,000 to B:
Mobile App → API Gateway → Authentication → Payment Service → Fraud/Risk → Account/Ledger → RTP Network → Receiver Bank → Confirmation
The important stages are:
Payment request — Customer submits amount and beneficiary information. The system creates a unique transaction/payment ID.
Authentication — The bank verifies the customer using credentials, PIN, token, MFA, etc.
Validation — Check account status, beneficiary details, transaction limits and available balance.
Fraud/Risk check — Rules or models evaluate whether the transaction looks suspicious.
Payment processing — The payment service records the transaction and coordinates the debit.
RTP network — The sending institution sends the payment instruction through the relevant real-time payment rail/network.
Receiving bank — The receiving institution validates the request and credits the beneficiary.
Confirmation — Success/failure status travels back to the sender, and the transaction records are reconciled.
What an SRE needs to worry about
Imagine the customer taps Pay, but a network timeout occurs. The app doesn't know whether the bank actually processed the ₹10,000.
The customer taps Pay again.
You must prevent:
₹10,000 + ₹10,000 = ₹20,000 accidentally debited.
This is why idempotency is extremely important in payment systems. The same payment request should not create multiple financial transactions.
For example:
Payment ID: PAY-12345
Request #1 → timeout
Request #2 → same Payment IDThe payment service recognizes PAY-12345 and returns the existing transaction result instead of processing another debit.
Another important concept is transaction state:
CREATED
↓
VALIDATING
↓
PROCESSING
↓
SENT
↓
SUCCESSFailures could lead to states such as:
FAILED
REJECTED
TIMED_OUT
PENDINGA PENDING transaction is particularly important. You cannot simply assume it failed, because the receiver may actually have been credited.
SRE monitoring
For RTP, I'd expect dashboards/alerts around:
Availability → latency → transaction success rate → error rate → pending transactions → timeout rate → duplicate attempts → queue lag → database health → downstream-bank/network failures.
Example SLO:
99.99% of payment API requests successfully processed, with 99% completing within the agreed latency target.
Very common interview question
Interviewer: "A customer says money was debited, but the beneficiary didn't receive it. How would you investigate?"
A strong SRE approach is:
Transaction ID → API logs → payment service → ledger/debit record → outbound message → RTP network response → receiving-bank response → transaction state → reconciliation
You should not immediately retry the payment, because that could create a duplicate.
This connects several important SRE topics you've been learning: SLA/SLO/SLI, load balancing, caching, Kubernetes, Prometheus, Elasticsearch and Kibana. RTP is a good system to use for practicing all of them together.
No comments:
Post a Comment