Wayfair SDE Interview Question 2024 December | Pointers & Cyclic Sort | on-campus
Question · Posted Jun 2026
Question 1: Container With Most Water Problem Statement You are given an integer array height of length n. There are n vertical lines drawn such that the two endpoints of the i-th line are (i, 0) and (i, height[i]). Find two lines that together with the x-axis form a container, such that the container contains the absolute maximum water. Return the maximum amount of water. Examples Example 1: Input: height = [1,8,6,2,5,4,8,3,7] Output: 49 Explanation 1: The optimal container is ...
The full answer & interview discussion are available to premium members.
Log in Create a free account