OA1 : Debugging Round - 7 problems in 20 minutes.
All of them were very easy and can be done even in 10 minutes.
OA2: 70 minutes two problems
Problem 1: Find the largest palindrome in a string which I had already solved prior to assesssment.
Passed 10/11 test cases.
Problem 2: A wareshouse has a List<List<>>of crates where each list stores the x and y co-ordinates of crates. There is truck that has a limited space and can only carry few crates if not all. x-y co-ordinates of crates determines the distance between crate and the truck - sqrt(x^2 , y^2). Crates with minimum distances are given priority and hence are laoded first in the truck.
Ex: [[1,2],[3,4],[1,6]] , truck capacity= 2
return [[1,2] [3,4]]
Approach I used:
TreeMap<Double,List< List>> where key is the distance and if the distance already present in the map then update the List< List>
I passed 22/22 test cases.
OA3: Work simulation and logical reasoning which was relatively easy.
Virtual Interview:
He asked me about my past projects that I've worked on and gave me detailed explaination about the Internship. This went on for 20 minutes.
Question:
https://leetcode.com/problems/missing-element-in-sorted-array/
I solved it in 5 minutes in O(n) and for the optimal solution i suggested binary search but I could'nt implement it. I asked for some hints and then I wrote the code but it was not entirely right since few test cases were failing and then the time was up since the whole intereview is just for 45 minutes.
I got rejection two days later.
Preparation:
I have solved 170 problems on leetcode but what I feel from my experience is that correctness of an algo is not enough so please do not just bother working hard to solve as many problems but do try to come up with better solution.
It's a dissappointment after working so hard for two and a half months but it is what it is. Keep working hard..
I just hope and wish this post helps someone in landing a job.
Good luck guys :)