Maximize area between vertical lines
Company: Oracle
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: medium
Interview Round: Technical Screen
Quick Answer: This question evaluates algorithmic reasoning with arrays and the ability to optimize pairwise measurements, specifically assessing understanding of how positional distance and element values combine to maximize an area metric.
Constraints
- Inputs are Python literals matching the function signature.
- Return a deterministic exact-match value.
Examples
Input: ([1,8,6,2,5,4,8,3,7],)
Expected Output: 49
Explanation: Classic example.
Input: ([1,1],)
Expected Output: 1
Explanation: Two lines.
Input: ([0,2,0,3],)
Expected Output: 4
Explanation: Zero heights.
Hints
- Pick a representation that makes the requested operation direct.
- Handle empty inputs and boundary cases first.