Meta·Software Engineer·Onsite - Coding / Algorithms
- Given an integer array, find the longest strictly increasing contiguous subarray. Return the length and start/end indices. Target O(n) time and O(1) space. How do you break ties when multiple subarrays share the same maximum length?
- Compute the length of the longest strictly increasing subsequence in an integer array and reconstruct one valid subsequence. Aim for O(n log n) time with O(n) space. Explain the data structures involved and why the approach is correct.
- Given an m x n grid of integers, find the length of the longest strictly increasing path where each step moves to one of the four orthogonal neighbors. Optionally return one such path. Grid can be up to 500x500. Design the algorithm and analyze time and space complexity, including how you prevent revisiting states.
“Easiest of the three.”