Uber·Software Engineer·Technical Phone Screen
- You have an array of vaults, each holding some positive integer amount, and a fixed number of hours h. Each hour you can work on only one vault and remove at most k units from it. What is the minimum integer k that lets you empty all vaults within h hours? Walk through your algorithm and its time complexity.
- Given a set of distinct positive integers and a target value, can you determine whether any subset sums exactly to the target? Describe the algorithm, its complexity, and how you'd reconstruct an actual valid subset if one exists.
“Classic binary search on the answer, basically the same shape as the 'eating bananas' problem.”