Hey folks,
Leetcode community was super helpful for me to prepare for interview, so here's me, trying my best to help others.
Recruiter approached me in December 2024 and gave 1 month of time for preparation. Phone screen round was scheduled in first week of January. Grinded hard for 1 month.
Phone Screen Round -
Interviewer quickly introduced himself and quickly jumped on to the question.
Question -
You are given 4 patterns
F1 - *
F2 - 192.168.*
F3 - 192.168.2.*
F4 - 192.168.2.1
You are given queries
192.168.7.1
192.168.2.1
192.168.2.7
192.167.1.1
You have to return pattern name which is most precisely matching with the query.
Ans - [F2, F4, F3, F1]
I suggested to use Trie, interviewer agreed and went on to code it. Finished with 5 mins to spare.
Feedback from HR - Solved question optimally but interviewer didn't get time to ask follow-up. But good to go for next round.
Onsite 1 -
You have a wooden table of square shape, you are provided with a list of cakes. Cakes are square in shape and placed randomly on the table. You are given bottom left corner's co-ordinate for the cake and length of a side of the cake. You need to find a y-co-ordinate such that area of cakes are divided into exactly half..
I suggested to use Line Sweep Algorithm for this and we did couple of dry runs together, he seemed fine with approach, but added - Co-ordinates are double (eg: 2.5, 5.0)
I was able to solve this with a small hint using Binary Search.
Feedback - Overall feedback was positive but interviewer mentioned he had given a hint. (Hire)
Onsite 2 -
You are given an integer array nums of length n and a 2D array queries, where queries[i] = [l, r].
For each queries[i]:
- Select a subset of indices within the range [l, r] in nums.
- Decrement the values at the selected indices by 1.
A Zero Array is an array where all elements are equal to 0. Find out whether array can be made a zero array after applying the queries.
I suggested line sweep algorithm again, and it was working correctly. Time Complexity - O(n)
He didn't ask me to code and updated the question -
Find out first query where array will be made Zero Array.
I was not able to solve this problem optimally, suggested a O(n^2) solution but he wanted optimal approach. As we were running out of time, asked me to code Line Sweep code for first question.
I searched later, I think optimal solution is by using Segment Trees. I hadn't practiced this topic before. If you know any other way to solve this optimally, do let me know.
Feedback - Negative. (Leaning No Hire/ No Hire)
Onsite 3 -
MK Average - https://leetcode.com/problems/finding-mk-average/
Solved this using TreeMap. Had made one error in code, which was asked by interviewer as I was explaining my code but quickly fixed it. I had given solution with overall time complexity of O(M * log (k)).
Interviewer asked if I can optimize it further but I couldn't think of it.
Feedback - HR mentioned feedback is average and interviewer had mentioned that there was an error in code.
Googlyness -
Standard situation based questions.
Self Verdict - Strong Hire.
Currently, waiting for further steps but recruiter mentioned as the feedback is not great, I might have to give additional coding rounds, so keep practising DSA.
Chances are slim but fingers crossed for now.


