EASYasked at 2 companies

Maximum Area of Longest Diagonal Rectangle

A easy-tier problem at 37% community acceptance, tagged with Array. Reported in interviews at Accenture and 1 others.

Founder's read

You're given an array of dimensions and need to find the maximum area of a rectangle with the longest diagonal. It sounds geometric, but it's really about spotting a mathematical relationship. Accenture and Atlassian both ask it. The acceptance rate sits at 36%, which means a third of candidates are missing the trick. The trap is overthinking it: most people write loops and nested logic when the problem has a much cleaner pattern. If this hits your live assessment and you blank on the relationship between diagonal length and area, StealthCoder surfaces the solution invisibly while you stay calm.

Companies asking
2
Difficulty
EASY
Acceptance
37%

Companies that ask "Maximum Area of Longest Diagonal Rectangle"

If this hits your live OA

Maximum Area of Longest Diagonal 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 at a top-10 tech company who can solve these problems cold but didn't want to trust himself in a 90-minute screen share.

Get StealthCoder
What this means

The key insight is that for a rectangle with sides a and b, the diagonal d satisfies d^2 = a^2 + b^2. Instead of sorting, comparing, or building complex logic, you realize that maximizing area while keeping the longest diagonal constant means finding which pair of dimensions gives you the largest product. The gotcha: candidates often try to track diagonals explicitly or assume the largest dimensions automatically win. They don't. You need to check all valid combinations and compute a^2 + b^2 for each, then pick the pair with max area among those sharing the longest diagonal. Array iteration is straightforward, but the math shortcut is what separates a two-minute solve from a five-minute fumble. StealthCoder is the safety net when the pattern doesn't click during screen share.

Pattern tags

The honest play

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

Maximum Area of Longest Diagonal Rectangle recycles across companies for a reason. It's easy-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 at a top-10 tech company who can solve these problems cold but didn't want to trust himself in a 90-minute screen share. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Maximum Area of Longest Diagonal Rectangle interview FAQ

Is this problem actually about geometry or just array manipulation?+

It's geometry disguised as an array problem. You're working with an array of dimensions, but the real work is applying the Pythagorean theorem and comparing products. The array part is trivial; the math pattern is what you need to see.

Why is the acceptance rate so low for an easy problem?+

Because candidates assume they need to sort, filter, or track state across complex loops. The actual solution is much simpler once you recognize the mathematical relationship. Most people overcomplicate it before they even code.

Does the order of dimensions matter?+

No. The diagonal calculation is symmetric: a^2 + b^2 = b^2 + a^2. Once you compute the diagonal and area for a pair, the order doesn't change the result. You just need to check all combinations.

Is this still actively asked at Accenture and Atlassian?+

Yes, both companies have reported it. At this difficulty level and acceptance rate, it's a reliable screening question. Not everyone who sees it solves it quickly, so mastering the pattern gives you an edge.

What's the biggest pitfall in solving this live?+

Treating it like a hard problem. Candidates start with nested loops and complex tracking when they should start by writing the diagonal formula and area formula, then iterating once through pairs. Keep it simple and the pattern emerges fast.

Want the actual problem statement? View "Maximum Area of Longest Diagonal 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.