PhonePe | SDE-1 | Bangalore | Aug 2022 | Selected
Summary
I was selected for the SDE-1 role at PhonePe after a rigorous four-round interview process held in Bangalore in August 2022, which included multiple challenging coding rounds, in-depth technical discussions on DSA and system design, and a final HR-technical evaluation.
Full Experience
I had a comprehensive interview experience with PhonePe for the SDE-1 role, which started with an offline campus visit to PEC – Chandigarh in August 2022. The entire process consisted of four challenging rounds.
The first round was an Online Test of 90 minutes on the DoSelect platform, featuring four hard-level coding questions. I faced problems similar to Split Array Largest Sum and a variation of Flower Planting With No Adjacent involving minimum cost. There was also a challenging DP problem about maximizing people passing a test based on scores and bounds, and a unique array permutation problem defining "sadness." I managed to pass 7 out of 10 test cases for the first two and attempted the others. Out of 181 eligible candidates, 18 were shortlisted.
The second round was a Technical Round lasting 60 minutes. After my introduction, the two interviewers focused on DSA. I solved Amount of Time for Binary Tree to Be Infected by explaining both BFS and DFS approaches, writing pseudocode for BFS, and implementing DFS. For Sum of Subarray Minimums, I initially gave a brute-force O(N^2) solution, then optimized it to O(N) using a stack, correcting my code after the interviewer pointed out edge cases. Both interviewers were satisfied. 11 candidates proceeded to the next round.
The third Technical Round also lasted 60 minutes and immediately delved into DSA. I explained the recursive (brute force) approach for Generate Parentheses to the interviewer's satisfaction. For Burst Balloons, I fully explained the DP approach, including the state definition dp[i][j], but couldn't write the complete code, yet the interviewer was content with my explanation. Finally, for Optimize Water Distribution in a Village, I proposed an MST approach for pipes and a power set for wells. When prompted for optimization, I received a hint from the interviewer that enabled me to explain the complete optimal solution. 5 candidates were shortlisted for the final round.
The fourth and final round was a 70-minute HR + Technical Round. It began with company-specific HR questions such as "Why PhonePe?", "Why not Google/Amazon?", and "What made me choose PhonePe?". Following this, we had an in-depth discussion about my E-Commerce Web Application project, which I built using Django REST Framework. I confidently answered all project-related questions. Then, I was given a puzzle: "Find the faster rat among 12 rats using 4 cakes." This was followed by variations, including finding the faster rat among 16 rats and determining the maximum number of rats for which the faster one could be found using 4 cakes. I came up with a solution for up to 36 rats and indicated the answer would be in the 36-48 range. I was also asked CS fundamentals questions like the "Difference between Stack and Heap memory," "Inheritance," "Virtual functions and classes in C++," and "Deadlock conditions and scenarios." I admitted I wasn't prepared for DBMS questions when asked. The round concluded with a system design problem: "Design a system for a single lift with 1000 building floors." After explaining my approach, the problem was extended to "design for 3 lifts" and identify suitable data structures. My initial approach using maps and different classes was not satisfactory, but I revised it using virtual classes and maps, which was accepted.
Ultimately, I was one of 4 candidates selected, marking a significant achievement for me, especially after not securing an internship and getting a placement on the first day of the placement cycle. I'm thrilled to give back to the community!
Interview Questions (18)
Given N people and two arrays: one of Scores and one of Bounds on N people. The initial score to pass a certain test was 0. A person is considered to pass if their score is greater than a variable score. After passing, their score value is not considered, and their bound value gets added to the score. The task was to calculate the maximum number of people that can pass the test.
Given two arrays A and B, where B is a permutation of array A. Sadness is defined as the most jumbled permutation of array A. For example, if A: 1 3 2 2 and B: 1 2 3 2, this is not the maximally sad array pair, as the most sad would be 2 2 3 1. The task was to return if array B is the most sad array possible.
You have 12 rats. One rat eats faster than the other 11 (and the other 11 eat at an identical pace). You have 4 cakes (which the rats do want to eat). You can put as many rats on a cake as you want at a time, and you can use as many cakes at a time as you want. Give a way to find the faster rat.
The puzzle remains the same, but you are given 16 rats instead of 12.
Determine the maximum number of rats from which we can find the faster rat using 4 cakes.
Explain the difference between Stack memory and Heap memory.
Explain what inheritance is.
Explain what a virtual function and virtual class in C++ are, along with their applications.
Explain what deadlock is, the conditions required for deadlock, and a general scenario where deadlock may occur.
Design a system for a single lift in a building with 1000 floors.
Extend the single lift system design to accommodate 3 lifts, and specify which data structures would be used for the implementation.
Preparation Tips
My preparation primarily focused on Data Structures and Algorithms, practicing a variety of problems to optimize solutions. For the HR + Technical round, I also researched company-specific questions and prepared to discuss my projects in detail. I refreshed my knowledge of core CS subjects like Operating Systems and Object-Oriented Programming concepts but admittedly had not prepared for DBMS topics.