News · New this week
UPI system design: why GPay, PhonePe and Paytm fail together
Apps are separate, but every request passes through one shared NPCI switch. That one fact explains most of the failure pattern.
Rohan scans a QR code. PhonePe fails. He tries GPay, and that fails too. In an interview this turns into "design a UPI app", and the answer comes down to one shared component in the middle.
Why direct integration gets rejected
The obvious design connects every app straight to every bank. With 10 apps and 100 banks, that's 1000 links. Each link is a separate integration, which means separate code to build and maintain. Reject.
The load makes it worse. There are millions of payments a day. The two requirements are that money must never be deducted twice, and that the answer must come back quickly.
The path a payment takes
Follow one payment from the phone.
You scan the QR and enter your UPI PIN. The payment app (GPay, PhonePe or Paytm) receives it. These apps are the front door. They don't hold your money.
Each app has a partner PSP bank. That bank forwards the request onward. If one app gets stuck, another app can still work, because they don't share this step.
Next comes the NPCI switch. It's one central body that connects every app and every bank and passes requests between them. This is what replaces the 1000 links.
From there the switch asks your bank for a debit, meaning the money is cut. It asks the receiver's bank for a credit, meaning the money is added.
What happens when no reply comes
Sometimes the answer never arrives. The transaction ID covers that case. Think of it as the payment's receipt number. You use it to check the status of that payment.
Who fails when something is slow
If an app is down, switching to another app works. If a bank is slow, only that bank's users fail. If the switch is slow, every app fails, because every request goes through it.
So switching from PhonePe to GPay helps when the app is the problem. It doesn't help when your bank or the switch is slow. The apps are different, but the switch is one.
This is the standard design for UPI-style systems. It isn't something specific to NPCI.
What to try
Next time you practise this question, draw the chain in order: phone, payment app, PSP bank, NPCI switch, banks. Then mark what happens when each box is slow. Say the last line out loud: apps are separate, the switch is one, so a slow switch means everything fails.



