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