Machine Coding Round
Questions: A user performs various actions in the PhonePe app, such as signing up, logging in, checking offers, recharging, or making UPI transfers. The task was to design a system where multiple workflows could be configured. 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
After submitting the zip file, a follow-up call was scheduled to explain the solution to the panel.
Candidate's Approach
No approach provided.
Interviewer's Feedback
No feedback provided.
System Design Round
Questions: The task was to design a notification service that supports email, SMS, and push notifications. Different types of notifications may have varying delays. The system needed to scale dynamically for specific types of notifications.
Candidate's Approach
No approach provided.
Interviewer's Feedback
No feedback provided.