Skip to content
LakeBench
ProblemsCommunityPricing
Sign inStart practicing

Container With Most Water

Python data engineering interview problem. Difficulty: beginner. Pattern: Two Pointers. About 10 minutes. Part of the Pro drill bank.

Max area formed by two vertical lines and the x-axis. Treat this as a production helper: match the contracted return shape, including empty and duplicate inputs.

Implement max_area(height: list) -> int.

Constraints

  • At least two lines.
  • Width is index difference.

Examples

Input: max_area([1, 8, 6, 2, 5, 4, 8, 3, 7]) Output: 49 Lines at index 1 and 8.

Topics: lakebench, python, area, two pointers.

More Python interview questions · All interview problems · Learn data engineering

beginner

Container With Most Water

Interview-style drill: Max area formed by two vertical lines and the x-axis.

Implement `max_area(height: list) -> int`. Example: `[1, 8, 6, 2, 5, 4, 8, 3, 7]` → `49`. Keep the harness.