Background:
One of my linkedin connections liked a post, which said "My team is hiring in Bnagalore". Previously I got referrals from Amazon, but somehow wasn't getting a call. It wasn't really referral for his/her own team (I thought I was blocked from Amazon, lol). Sent that guy connection, pinged him for referral, shared resume and he referred me.
Got Hackerrank link for the test. It was 90 mins test.
O(N*M).N points on 2D plane and a source point. Give K nearest points, consider distance as Euclidean or Manhattan (any one of them) distance.
K points. Once a new point comes, check if it is potential nearest one, then keep it in the PQ and remove the farthest one.O(NlogK), can be done using sorting the distance in O(NlogN).Few days later got email saying that I cleared online round, they don't have any dates on September, they'll get back to me once they have dates. I was travelling from Bangalore to my hometown in last week of Sept, so asked recruiter not to consider that weekend. On the Tuesday evening she called me up to tell they have dates on that very Saturday and whether I am interested or not. I initally said no, later called her up to schedule the interview. I took the risk to take the interview since I needed the job badly(MS was unbearable for me, it was affecting me mentally), since I was moving out I hardly had any time to prepare for onsite till Thursday.
Interviewer were very upfront saying we will discuss 2 questions in 45-50 mins. Last 10 mins for for any questions ( read they'll ask LP questions ).
Houses are arranged as tree. ith house had fire and at each minute fire propagates to it's neighbours (bothways). After nth minute print all the houses that will be on fire.
O(N)1209. Remove All Adjacent Duplicates in String II
O(N)LP Questions
Same as last round, 2 questions will be discussed interviewer told me at the very beginning.
N chocolate boxes are there initially. Each time you eat a chocolate from the ith box, that box gets filled up with floor(c_i/2) no of chocolates. You can have one chocolate box in 1 minute. Maximize the no of chocolates you can have in A mins. Since, she was very new interviewer. Even though I already solved this questions in 7-10 mins, she continued discussing this question some silly things just to allot this question first 25 mins, which could've been helpful for me for the next question.
O(NlogN)relationship(a,b) defines a and b are friends. If a->b are friends and b->c are friends, then a->c are friends as well. Given q queries, check if x and y are friends or not.
DSU with path compression(that took almost 10 mins of discussion). It was difficult to write up complete DSU code from the scratch and later do a dry run on a given example and also make her realize how path compression is helping to reduce complexity.O(N+Q), can be done using BFS+Indexing in O(Q) (don't know why it didn't click that time, I even discussed using BFS -_- Duh!)LP Questions
Recruiter told me earlier, that if my performance are good enough, then I will have 3rd round on the same day as well. I didn't have a proper setup(everything shifted to my hometown due to movement) to give an interview. This round was the mangerial round and was scheduled around 6:30PM in the evening. Interviewer was really nice and friendly. He intially thanked and apologized for scheduling such a hectic interview schedule on weekend.
O(N).I got a call on Monday evening saying, I cleared all the rounds and I will have my last round on Thursday on 9AM. That was my last week on Bangalore and I was staying with one of my friends, because I had no amenities in my flat. So woke that guy, kick him out of his room (Sorry bro :P ) and had my last interview.
Why leave MS? Quite lengthy discussion on this topic.
Give me an example where manager said it was okay, but you were not satisfied with the result and move ahead to did something extra.
Snakes and Ladders very higher level API/system design.
Finally got the call on next Monday that I got selected and it was such a relief for me. Later we negotiated on compensation and now just serving my notice period in MS.
Some tips: