PhonePe | Sr. SDE | 6.5 YOE | Interview questions

Anonymous User
1113
Sep 15, 2024

Note: Questions are slightly modified due to NDA

Machine Coding Round

The recruiter shared a Google Meet invite with several candidates. After joining, they announced the question and asked candidates to email their solution as a zip file to HR. Candidates were allowed to leave the call once they understood the question. It seemed acceptable to take slightly more than the allotted two hours to submit the solution via email.

The question was as follows: 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:

  1. KYC pending
  2. Verified user (with first payment pending)
  3. First payment complete
  4. 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.

System Design Round

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.

Preparation

For those interested in how I prepared, check out my blog on Google's interview preparation.

Comments (1)