HARDasked at 1 company

Minimize Manhattan Distances

A hard-tier problem at 31% community acceptance, tagged with Array, Math, Geometry. Reported in interviews at Deutsche Bank and 0 others.

Founder's read

Minimize Manhattan Distances is a hard-tier problem that shows up in Deutsche Bank interviews. Only about 31% of submissions pass, which tells you it's testing a specific insight most people miss on first sight. The trap is thinking you need to track every pairwise distance or simulate some greedy assignment. But there's a coordinate transformation that makes the whole problem collapse into something elegant. If you hit this live and freeze on the geometry, StealthCoder will surface the working solution invisible to the proctor.

Companies asking
1
Difficulty
HARD
Acceptance
31%

Companies that ask "Minimize Manhattan Distances"

If this hits your live OA

Minimize Manhattan Distances 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 an Amazon engineer who watched the leaked-problem repo become an industry secret. He decided you should have it too.

Get StealthCoder
What this means

The key insight is rotating the coordinate system. Instead of minimizing sum of |x1-x2| + |y1-y2| directly, you transform to u = x+y and v = x-y. In this new space, Manhattan distance becomes Chebyshev distance (max of absolute differences), which decouples into independent x and y problems. Once you see that, the problem becomes: for each coordinate, sort and pair elements to minimize the max gap or sum of ranges. Most candidates get stuck on the geometry and never try the transform. That's where preparation matters. If the OA catches you off-guard on this one, StealthCoder bridges the gap in real time.

Pattern tags

The honest play

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

Minimize Manhattan Distances recycles across companies for a reason. It's hard-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 an Amazon engineer who watched the leaked-problem repo become an industry secret. He decided you should have it too. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Minimize Manhattan Distances interview FAQ

Is this actually asked at Deutsche Bank?+

Yes, it's in their interview reports. It's rare across the industry (only one major company in the data), so it's a specialized ask. If you're interviewing there, expect hard geometry and math problems. This one is a realistic warmup.

What's the trick I'm missing?+

The coordinate rotation. Transform Manhattan to Chebyshev by mapping (x, y) to (x+y, x-y). Then the problem separates. Most people waste time on pairwise logic or greedy assignment. The math insight is the entire solution.

How do I know when to apply coordinate transforms?+

When you see Manhattan distance in a problem, especially paired with optimization or pairing tasks, try a coordinate shift. It won't always work, but it's a standard pattern in geometry problems. This problem is a textbook application.

Is sorting involved?+

Yes. Once you transform coordinates, you sort each dimension independently to pair or group elements optimally. Sorting + greedy matching on the transformed axes is the standard finish after the insight.

How hard is 31% acceptance really?+

Hard. Below 35% usually means the problem requires a non-obvious pattern or math trick that can't be brute-forced. Most people who fail don't find the coordinate transform. Those who do pass quickly.

Want the actual problem statement? View "Minimize Manhattan Distances" 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.