MEDIUMasked at 5 companies

Minimum Area Rectangle

A medium-tier problem at 55% community acceptance, tagged with Array, Hash Table, Math. Reported in interviews at Verily and 4 others.

Founder's read

Minimum Area Rectangle is a medium-difficulty geometry problem that shows up at Google, ByteDance, Verily, and other companies hunting for candidates who can spot structure in coordinate space. You're given a set of points and need to find the smallest axis-aligned rectangle that can be formed by four of them. The 55% acceptance rate tells you most candidates either miss the hash table trick or get tangled in the geometry logic. If this lands in your live assessment and you blank on the approach, StealthCoder surfaces a working solution in seconds, invisible to the proctor.

Companies asking
5
Difficulty
MEDIUM
Acceptance
55%

Companies that ask "Minimum Area Rectangle"

If this hits your live OA

Minimum Area Rectangle is the kind of problem that decides whether you pass. StealthCoder reads the problem on screen and surfaces a working solution in under 2 seconds. Invisible to screen share. The proctor sees nothing. Built by an engineer who got tired of watching his cohort grind for six months and still get filtered at the OA stage.

Get StealthCoder
What this means

The naive approach tests all combinations of four points, which is O(n^4) and too slow. The real insight is to iterate over all pairs of points as potential diagonal corners, then use a hash table to check if the other two corners exist. But there's a catch: you need to verify that the four points actually form a rectangle, not just any quadrilateral. Most people either skip the geometry validation or implement it wrong. You'll want to sort your pairs by distance or use a systematic hash structure to avoid duplicate work. The Array, Hash Table, and Geometry topics collide here. If the geometry part trips you up during the live OA, StealthCoder runs invisibly and hands you the validated solution before the timer matters.

Pattern tags

The honest play

You know the problem. Make sure you actually pass it.

Minimum Area Rectangle recycles across companies for a reason. It's medium-tier, and most candidates blank under the timer. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds. Built by an engineer who got tired of watching his cohort grind for six months and still get filtered at the OA stage. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Minimum Area Rectangle interview FAQ

Is this problem still asked at Google and ByteDance?+

Yes. It's in the active rotation at both companies, along with Verily, Snap, and Flipkart. The 55% pass rate suggests it's a consistent filter, not a rare outlier. If you see coordinate geometry on the problem list, assume this is a realistic possibility.

What's the trick everyone misses?+

Using the diagonal as your pivot point. Hash the x and y coordinates of all points, then iterate pairs as diagonals. For each pair, calculate what the other two corners must be, and check if they exist in your hash table. Most people try all four-point combinations instead.

How does Math and Sorting fit into this?+

Math is your distance and corner-calculation logic. Sorting isn't always necessary, but some approaches sort points first to prune the search space or to make the diagonal iteration cleaner. It's an optimization, not a requirement.

Will I get partial credit if my solution is slow?+

Depends on the platform and time limits. A brute-force O(n^4) solution might time out entirely. Most online assessments expect you to hit O(n^2) with the hash table approach. Test your solution on the larger inputs before submitting.

How do I validate that four points form a valid rectangle?+

Check that opposite sides are equal and all four angles are right angles. Once you compute the four corners from a diagonal, verify they're distinct and lie in the point set. A quick area calculation on the two candidate diagonals also catches invalid quadrilaterals early.

Want the actual problem statement? View "Minimum Area Rectangle" on LeetCode →

Frequency and company-tag data sourced from public community-maintained interview-report repos. Problem, description, and trademark © LeetCode. StealthCoder is not affiliated with LeetCode.