def max_rectangle_area(points):
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.
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.
The candidate compared this follow-up to LeetCode 3380, which forbids other points inside the rectangle or on its border.
Discussion only: the report says no implementation was required, only the approach.
Two Waymo onsite reports, both describing LeetCode 939 changed from the smallest rectangle to the largest. One candidate enumerated x pairs and stalled on finding the shared y values efficiently, then used a set and passed that round; the interviewer stayed quiet until the code was done and discussed it afterwards. The other report (rejected after the onsite) adds two follow-ups: no other point inside the rectangle (compared to LeetCode 3380), and rectangles not parallel to the axes, which was discussion only, no code.
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.
What if the rectangle does not have to be parallel to the axes?
What if no other given point may lie inside the rectangle?
| Approach | Notes |
|---|---|
| Brute force column-pair scan | Check 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. |
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.
If you have had this round, tell us how close this page was. It is how we keep the pages accurate.