MEDIUMasked at 2 companies

Get Biggest Three Rhombus Sums in a Grid

A medium-tier problem at 49% community acceptance, tagged with Array, Math, Sorting. Reported in interviews at Quora and 1 others.

Founder's read

Get Biggest Three Rhombus Sums in a Grid is a medium-difficulty problem that looks simple on the surface but trips up candidates who don't nail the pattern recognition. You're given a grid and need to find the three largest diamond-shaped (rhombus) sums. Quora and Capital One both ask it. The acceptance rate sits at 49%, which tells you most people either misunderstand the geometry, brute-force inefficiently, or miss an optimization. If this shows up in your assessment and you blank on the approach, StealthCoder surfaces the working solution in seconds while you stay invisible to the proctor.

Companies asking
2
Difficulty
MEDIUM
Acceptance
49%

Companies that ask "Get Biggest Three Rhombus Sums in a Grid"

If this hits your live OA

Get Biggest Three Rhombus Sums in a Grid 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. Made by a working FAANG engineer who treats the OA the way companies treat hiring: as a game with rules you should know.

Get StealthCoder
What this means

The core trick is recognizing that a rhombus on a grid is defined by a center point and a radius, and you can compute its sum efficiently without recalculating every overlapping diamond. Most candidates try brute force: iterate all possible centers and radii, compute each sum from scratch. That's correct but slow. The real edge is using prefix sums to answer range queries in constant time, then sort and pick the top three. The geometry itself is straightforward (for a radius r centered at (i, j), include all cells (x, y) where the Manhattan distance equals or is less than r). The painful part is implementing it cleanly without off-by-one errors on the boundaries. StealthCoder handles the index arithmetic and prefix-sum math so you don't burn time debugging.

Pattern tags

The honest play

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

Get Biggest Three Rhombus Sums in a Grid 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. Made by a working FAANG engineer who treats the OA the way companies treat hiring: as a game with rules you should know. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Get Biggest Three Rhombus Sums in a Grid interview FAQ

Is this really a MEDIUM or does it feel harder?+

It's medium by tag but tests multiple skills at once: 2D prefix sums, geometry, sorting, and clean iteration. The 49% acceptance rate confirms candidates underestimate it. The algorithmic difficulty is moderate; the implementation risk is high. Unforced errors sink most attempts.

What's the rhombus pattern I need to see?+

A rhombus is a diamond shape on a grid centered at (i, j) with radius r. A cell (x, y) is inside if the Manhattan distance abs(i - x) + abs(j - y) <= r. You iterate all valid centers and radii, compute the sum using 2D prefix sums in O(1), then extract the three largest.

Why does brute force fail here?+

Brute force alone is O(n^4) or worse if you sum each rhombus by iterating its cells. With prefix sums, you drop to O(n^2 * max_radius), which is efficient enough. The catch is that naive prefix-sum queries on rhombuses need careful boundary handling to avoid double-counting or missing cells.

Do I need a heap or is sorting enough?+

Sorting is simpler and sufficient. You compute all rhombus sums, sort them descending, and return the top three. A heap would be overkill unless the grid is enormous, which it typically isn't in interview settings. The problem lists both as topics; sorting is the cleaner choice.

Is this still asked at Quora and Capital One?+

Both companies have it on record. At 49% acceptance, it's not a trivial warm-up, so expect it to filter candidates who skip geometric problems or panic on 2D indexing. If you've drilled prefix sums and Manhattan-distance geometry, you're ahead of the pack.

Want the actual problem statement? View "Get Biggest Three Rhombus Sums in a Grid" 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.