Solve Reported OA Coding Problems
UpstartSoftware Engineer · Online AssessmentLast updated
This prompt evaluates algorithmic problem-solving skills across grid-based ordering constraints, array pair-sum identification, and minimum-difference computation, testing knowledge of data structures, time/space complexity, and correctness conditions.
The post describes several algorithm questions from an online assessment. The concrete problems that can be reconstructed are:
-
Remove Blocks in a Grid You are given an
m x ngrid of0s and1s, where1means a block exists. A block at position(r, c)can be removed only if there is no remaining block in the same row at any columnk > c. Remove blocks one at a time until all blocks are gone, and return any valid removal order as a list of coordinates. If multiple answers exist, return any one of them. -
Find Two Indices for a Target Sum You are given an integer array
numsand an integertarget. Return two distinct indicesiandjsuch thatnums[i] + nums[j] = target. If multiple answers exist, return any valid pair. Aim for linear time. -
Compute the Minimum Gap You are given an integer array
nums. Return the minimum absolute difference between any two distinct elements in the array.
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.