
Lokesh Ghule
IT 2023
PhonePe
SDE
780 Reads
π Online Coding Round
Duration: 90 minutes
Total Questions: 4
π Problems Given:
- 
Prime Number Cost Problem: - Given an array of numbers (Arr) and a cost array (Cost), each number must be formed by summing a single prime number multiple times.
- The cost of using a prime number xtimes isx * Cost[i].
- Example:
- Arr[i] = 10,- Cost[i] = 6
- 5 + 5 = 10β Cost =- 2 * 6 = 12(Minimum cost).
 
 
- Given an array of numbers (
- 
Max GCD Sum Problem: - Given an array of positive integers, find the maximum sum of GCD(arr[i], arr[i+1])for all adjacent pairs.
- You may rearrange the array in any order.
 
- Given an array of positive integers, find the maximum sum of 
- 
Function Dependency Execution Count: - Given an array representing dependencies of functions.
- Example: { -1, -1, 1, 1, 3 }- The 1st & 2nd functions execute anytime (-1).
- 3rd & 4th execute after the 1st.
- 5th executes after the 3rd.
 
- The 1st & 2nd functions execute anytime (
- Find total number of ways to execute all functions.
 
- 
Max Group Selection: - Given two arrays (AandB), select elements forming the largest possible group.
- Rules:
- If i-thelement is chosen, include at mostA[i]elements beforei.
- Include at most B[i]elements afteri.
 
- If 
- Example:
- A = { 1, 2, 0, 3 },- B = { 2, 2, 0, 1 }
- Maximum elements in a group = 3.
 
 
- Given two arrays (
β Results:
- Solved 1st problem completely and 2nd problem partially.
- Got shortlisted for the second round along with 10 other applicants.
β‘ First Technical Interview Round (30β35 min)
πΉ Questions Asked:
- 
Maximum Subarray Sum of a Circular Array: - Array can contain positive & negative elements.
- Example:
- Arr = { 2, -4, 3, -5, 1, 3 }β Answer = 6.
 
- Progressed from brute force β optimal (O(n)) approach.
- Dry ran multiple cases β Interviewer was satisfied.
 
- 
Diameter of a Binary Tree: - Initially unaware of this.
- Interviewer explained the concept.
- Asked to write pseudo-code for diameter of an N-ary tree.
- Solved in O(n) time.
 
β Advanced to the next round along with 5 other applicants.
π Second Technical Interview Round (40 min)
πΉ Questions Asked:
- 
Chocolate Bar Distribution: - Given Nchocolate bars of varying lengths.
- Can split bars but NOT attach them.
- Distribute them to Kstudents such that each gets equal length.
- Find max possible length per student.
- Approach: Binary Search on Answer β O(n log n).
 
- Given 
- 
Swapped Nodes in a BST: - Given a BST where two random nodes were swapped.
- Find and fix those nodes.
- Solved in O(n) time.
- Dry ran multiple cases β Interviewer was satisfied.
 
π― Third HR Interview Round (40 min)
π₯οΈ Topics Discussed:
- 
Computer Networks: - How data packets travel.
- How HTML, TCP/UDP work.
- Where & how code gets stored & executed.
- Interviewer helped wherever I got stuck.
 
- 
OOP & Inheritance: - Diamond problem in OOP.
- Behavior of protected & private members in inheritance.
 
π§© Puzzles Asked:
- 
Finding the Faster Mouse: - 12 identical mice β 1 is faster.
- 4 cakes available.
- Mice can pause/resume eating, can be rearranged anytime.
- Find the faster mouse.
- Solved independently.
 
- 
Fixing Wrongly Labeled Containers: - Containers labeled Red, Green, Red+Green but wrongly placed.
- Balls inside contain only Red, only Green, or both.
- Find correct labels with minimum ball picks.
- Solved using 2 balls β Optimized to 1 ball with hint.
 
β Felt good again after solving these puzzles.
π Verdict: Got Selected! π
- After 30-minute wait, they felicitated us with goodies.
- 4 applicants made it to the final selection list.
π₯ Conclusion
- A dream come true! π«
- Competitive Programming played a major role in my selection. π
Related Experiences
ATHARVA RAUT
Sell.do
Product Engineer
IT 2026
10/5/2025
Read Experience
710
ATHARVA RAUT
UPTIQ
SDE
IT 2026
10/4/2025
Read Experience
773
ATHARVA RAUT
ZS Associates
Business Technology Solutions Associate (BTSA)
IT 2026
10/4/2025
Read Experience
577
Sakshi Marbhal
Nice Systems
SDE
CS 2026
9/29/2025
Read Experience
833
Study Sangathan
Principal Global Services
TRAINEE DEVELOPER
IT 2026
9/23/2025
Read Experience
1357
Tejas Jaulkar
EQ Technologic
QA
EnTC 2026
9/14/2025
Read Experience
1027
Omkar Chavan
EQ Technologic
SDE
CS 2026
9/11/2025
Read Experience
1063
Soham Yedgaonkar
PhonePe
SDE
IT 2026
9/8/2025
Read Experience
1396
Nirogix
Cornerstone OnDemand
UX/UI Designer
CS 2027
9/5/2025
Read Experience
1406
Sakshi Gangurde
Barclays
SDE
IT 2026
9/3/2025
Read Experience
1702