PhonePe | Sr. SDE | 6.5 YOE | Interview questions
Summary
I interviewed for a Senior SDE position at PhonePe, where I encountered a challenging machine coding task involving the design of a configurable workflow system, followed by a system design round focused on a scalable notification service.
Full Experience
I recently interviewed for a Senior SDE role at PhonePe. The interview process included a Machine Coding Round and a System Design Round.
Machine Coding Round
This round started with the recruiter sharing a Google Meet invite. Once I joined, they announced the question and instructed us to email our solution as a zip file to HR. We were allowed to leave the call once we fully understood the question, and it seemed acceptable to take slightly more than the allotted two hours to submit.
The problem involved designing a system where multiple workflows could be configured. Users perform various actions in the PhonePe app, such as signing up, logging in, checking offers, recharging, or making UPI transfers. A workflow consists of several stages; for instance, an "onboarding workflow" might progress through stages like "KYC pending," "Verified user (with first payment pending)," "First payment complete," and "Eligible for a new user coupon."
Workflows are represented as directed graphs where each node is a stage. As a user performs actions, they transition between stages. For example, completing KYC would update the user’s stage from "KYC pending" to "Verified user (first payment pending)." Some stages could have multiple next stages, depending on the user’s action. The system had to support multiple workflows, and a single stage could appear in several. When the service received an action, it needed to update the stages of all workflows the user was part of and check for new workflows the user could onboard into.
The task emphasized implementing production-grade code, requiring classes for workflows, stages (considering singleton patterns), different action types (following SOLID principles), and a service layer for business logic. After submitting my solution, a follow-up call was scheduled to explain it to the panel.
System Design Round
The system design challenge was to architect a notification service capable of sending email, SMS, and push notifications. A key requirement was handling varying delays for different notification types and ensuring dynamic scalability for specific notification categories.
Interview Questions (2)
The task was to design a system where multiple workflows could be configured for users performing various actions in the PhonePe app (e.g., signing up, logging in, checking offers, recharging, UPI transfers). A workflow consists of several stages. For example, an "onboarding workflow" could have stages like:
- KYC pending
- Verified user (with first payment pending)
- First payment complete
- Eligible for a new user coupon
The workflow can be represented as a directed graph, where each node is a stage. As a user performs actions, they move from one stage to another in the workflow. For example, after "completing KYC," the app would send this action to the service, updating the user’s stage from "KYC pending" to "Verified user (first payment pending)."
Some stages may have multiple next stages, determined by the user's action. There can be multiple workflows in the system, and a specific stage might appear in several workflows. When the service receives an action, it must update the stages of all workflows the user is part of. Additionally, the system should check for workflows the user can onboard into due to their actions.
The task required implementing production-grade code, including:
- Workflow and stage classes (considering singleton patterns, etc.)
- Classes for different action types (following SOLID principles)
- A service layer to handle all business logic
The task was to design a notification service that supports sending email, SMS, and push notifications. Different types of notifications may have varying delays. The system needed to scale dynamically for specific types of notifications.
Preparation Tips
For those curious about how I prepared, I focused on a strategy that I've previously outlined. You can find more details on my approach to interview preparation, specifically for companies like Google, in my blog post here.