WhiteHat Jr Interview Experience
Telephonic Interview Process due to COVID-19
Round 1: Technical (DS & Algorithms)
The interviewer asked 2 questions, one was from the Arrays & the other was Graph Traversal.
- Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. Assume that there is only one duplicate number, find the duplicate one.
Constraints:- You must not modify the array (assume the array is read only).
- You must use only constant, O(1) extra space.
- Your runtime complexity should be O(n).
- There is only one duplicate number in the array, but it could be repeated more than once.
- Print all the possible paths from the top left to the bottom right of a m*n matrix.
Constraints:- From each cell, you can either move only to right or down.
- The difference between the previous and next element should be equal.