ByteDance·Software Engineer·Onsite - Coding / Algorithms
- Given a sorted integer array and a target value, return the index of the target using an O(log n) algorithm. Return -1 if not found.
- You're given an array of digits representing a nonnegative integer. Add 1 to it and return the result as a digit array, without converting the whole thing to a native integer type.
- Rearrange an integer array in place so all nonzero elements come first in their original order, with zeros pushed to the end. O(1) extra space required.
“Binary search, pretty standard.”