Design Payment Gateway like Razorpay.
MediumImagine building a payment gateway, much like Razorpay or Stripe, from scratch. This isn't about scaling to millions of transactions or handling complex network infrastructure (that's HLD). Instead, it's about the core object-oriented design: modeling payments, handling different payment methods, processing transactions, and managing webhooks. We'll focus on designing a robust and extensible system that can easily adapt to new payment methods and evolving business rules. The system needs to handle creating payments, processing them via different payment providers, handling asynchronous notifications (webhooks) from those providers, and updating payment statuses accordingly. We will avoid any real third-party integration and focus on simulating the interactions.
Requirements
Interview Simulation
Experience a realistic interview conversation. The interviewer will ask clarifying questions,and you'll reveal your understanding of the requirements.
Let's start by understanding the scope. What are the core functionalities this system needs to provide?
💡 Interview Tip
Identify the Actors (Who uses the system?) and their Use Cases (What are they trying to achieve?). Start with the 'Happy Path' scenarios.