Uber Interview Question

The question was a double binary search.