Capital One·Machine Learning Engineer·Online Assessment (OA)
- Given an array of daily website visit counts and a target number, return the earliest day index where the cumulative visits reach or exceed that target.
- Simulate a repeated subtraction process on an array: repeatedly find the first positive value, subtract it from all following elements until you hit something smaller, accumulate it into a result, and repeat until no positives remain.
- Place a series of labeled blocks with fixed shapes onto a grid, choosing the topmost then leftmost valid position for each, and return the final grid state.
- Given an array of house heights where you can only increase values, find the minimum number of increments to make the heights form either a strictly increasing or strictly decreasing sequence with step size exactly 1.
“Straightforward prefix sum scan.”