Microsoft bangalore interview questions
Anonymous User
737

I have 5 years of experience so mostly questions were around technical knowledge and domain knowledge, but two algorithmic problems I remember so I will share them here

  1. first missing positive integer
    1. first i sorted and linear search ( O(n logn))
    2. count sort and linear search ( space O( n) : time linear)
    3. tried to manipulate indices to store presence of a number ( constant space and linear time)
      1. corner cases like zeroes need to be handled
      2. had to write code for last approach
      3. couldn't solve it perfectly( able to explain the approach but code had some issues) but I was able to clear the round
  2. peak finding
    1. I knew that it is a binary search question and was able to explain the approach
    2. had to write the code ( i used recursive version of binary search) and was asked about some corner cases
      1. I dry ran for following cases to explain my code
        1. only one element
        2. only two elements
        3. last element is peak
        4. first element is peak
        5. one normal case to explain recursion
Comments (2)