Attentive·Software Engineer·Technical Phone Screen
- Given an array of positive integers and a target value, find the minimal length of a contiguous subarray whose sum is greater than or equal to the target. Return 0 if no such subarray exists.
- The function you wrote is deployed to production and it's crashing. Walk me through how you'd troubleshoot it.
- The input to this function is being read from S3 and it's too large to fit in memory. How do you adapt your solution?
- Write pseudocode for a 2D matrix variant of the problem: find the smallest sub-rectangle whose sum is greater than or equal to the target. Also discuss how you'd handle crashes in this version.
“They started me with a simplified version where the target was fixed at 3, which felt easy enough.”