
Lokesh Ghule
IT 2023
PhonePe
SDE
254 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
x
times 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 (
A
andB
), select elements forming the largest possible group. - Rules:
- If
i-th
element 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
N
chocolate bars of varying lengths. - Can split bars but NOT attach them.
- Distribute them to
K
students 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
Pratik Patil
PhonePe
Intern
CS 2025
3/8/2025
Read Experience
135
Anuja Babhulkar
Microsoft
Intern
EnTC 2026
3/6/2025
Read Experience
148
Mansi Apet
Barclays
Intern
CS 2026
3/6/2025
Read Experience
138
Siddhesh Jadhav
Siemens
Intern
CS 2026
3/5/2025
Read Experience
136
Lalit Mohane
Dell
Intern
IT 2026
3/4/2025
Read Experience
119

Megha Dandapat
Druva
SDE
IT 2023
2/25/2025
Read Experience
275

Megha Dandapat
Siemens
SDE
IT 2023
2/25/2025
Read Experience
260

Kunal Raut
PhonePe
SDE
CS 2022
2/24/2025
Read Experience
294
Shivendra Bhonsle
EQ Technologic
SDE
IT 2023
2/23/2025
Read Experience
278

Rohin Bhat
Bloomberg
SDE
CS 2023
2/23/2025
Read Experience
287