Backend Engineer
Find the first matching value in a sorted array.
- 1Your approach
- 2The follow-up
- 3Reflect & learn
THE INTERVIEWER ASKS
The scenario
Implement a search that returns the first index of a target in a sorted integer array, or -1 when absent.
How would you approach it?
Explain your assumptions, your approach, and why you chose it.