As reported: eBay SDE-2, DSA round (2026, one hour, code compiled and run): Container With Most Water — brute force first, then the optimised solution.
height[i] is the height of a vertical line at x = i. Choose two lines that, together with the x-axis, form a container holding the most water; return that maximum area (min(height[i], height[j]) · (j − i)).
This is LeetCode 11 — Container With Most Water.
Example 1
height = [1,8,6,2,5,4,8,3,7] -> 49 (lines at 1 and 8: min(8,7) · 7)
Example 2
height = [1,1] -> 1
Constraints: 2 ≤ n ≤ 10^5; 0 ≤ height[i] ≤ 10^4.
Code runner format: one line, height as JSON. Implement maxArea(height); the harness prints the area.