AO
Back

Maximum-Area Rectangle from Points

CodingOnsiteLast reported April 2026Low Frequency

Problem Overview

Two first-hand onsite reports, both describing it as LeetCode 939 (Minimum Area Rectangle) with the smallest rectangle changed to the largest. You get points in the plane; find the largest-area axis-parallel rectangle whose four corners are all given points. One candidate enumerated pairs of x values, found the y values the two columns share, computed the area, and passed after getting stuck for a while on finding the shared y values efficiently; a set did it. In that round the interviewer was quiet until the code was done. The other report adds two follow-ups.

Part 1 — The largest rectangle

Write max_rectangle_area(points: list[list[int]]) -> int: the largest area of an axis-parallel rectangle whose four corners are all in points (a list of [x, y] integer pairs). Return 0 when no rectangle exists.

Part 2 — No other point inside

Reported follow-up: no other given point may lie inside the rectangle. The candidate compared it to LeetCode 3380, which also forbids points on the border. Write max_rectangle_area_no_interior(points: list[list[int]]) -> int, returning 0 when no rectangle qualifies. Ask whether a point on an edge counts; the tests never put a point on a candidate rectangle's edge, so either rule passes.

Spoken follow-up (not graded) — rectangles that are not axis-parallel. The same report's second follow-up was discussion only; no code was required.

The function names and the 0 for no rectangle are our setup.

Follow-up Arc

Interviewers escalate through these phases. The order varies, but most candidates see at least one from each bucket.
Concurrency · 1Trade-off discussion · 1
Concurrency

What if the rectangle does not have to be parallel to the axes?

Probes for: After the no-interior-point follow-up
Trade-off discussion

What if no other given point may lie inside the rectangle?

Probes for: After the base problem

Approach Trade-offs

Approaches actually attempted in reports — including ones that lost candidates time. Pick deliberately.
ApproachNotes
Brute force column-pair scanCheck all y-values for every x-pair without a set; simpler to implement but slower due to lack of O(1) lookup for common y-values.

What Reports Emphasize

Common mistakes: Getting stuck on how to efficiently find common y-values between two columns — one candidate mentioned spending extra time here before settling on a set-based solution.

Interviewer hints: The interviewer was 'pretty quiet throughout' while the candidate coded, only beginning discussion after the solution was complete.; The second follow-up (non-axis-parallel rectangle) explicitly does not require implementation — discussion of approach is sufficient.

What passers do: One candidate enumerated pairs of x values, found the y values both columns share and computed the area; they got stuck for a while on finding the shared values efficiently, used a set, and passed the round.

Practice

Write your own against 8 test cases, or read the worked solution — approach, complexity, and code that runs.
Did this match your interview?

If you have had this round, tell us how close this page was. It is how we keep the pages accurate.

Waymo · Coding · Reported 2× across candidate reports
Is this helpful?