PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Dark Alpha Capital

Minimize Total Assignment Distance

Last updated: Mar 29, 2026

Quick Overview

This question evaluates competency in combinatorial optimization, assignment/matching problems, and reasoning about Manhattan distance cost metrics. Commonly asked to assess algorithmic reasoning about constrained assignments, search and complexity trade-offs, it belongs to the Coding & Algorithms domain and emphasizes practical application of algorithm design and implementation rather than purely conceptual theory.

  • medium
  • Dark Alpha Capital
  • Coding & Algorithms
  • Software Engineer

Minimize Total Assignment Distance

Company: Dark Alpha Capital

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Technical Screen

You are given the coordinates of `n` analysts and `m` field devices on a 2D grid, where `1 <= n <= 10` and `n <= m <= 15`. Each analyst must be assigned exactly one distinct device, and each device can be assigned to at most one analyst. The cost of assigning analyst `i` at `(ax[i], ay[i])` to device `j` at `(dx[j], dy[j])` is the Manhattan distance: `|ax[i] - dx[j]| + |ay[i] - dy[j]|` Return the minimum possible total assignment cost after assigning a unique device to every analyst. Design an algorithm efficient enough for the given constraints.

Quick Answer: This question evaluates competency in combinatorial optimization, assignment/matching problems, and reasoning about Manhattan distance cost metrics. Commonly asked to assess algorithmic reasoning about constrained assignments, search and complexity trade-offs, it belongs to the Coding & Algorithms domain and emphasizes practical application of algorithm design and implementation rather than purely conceptual theory.

Dark Alpha Capital logo
Dark Alpha Capital
Feb 24, 2026, 12:00 AM
Software Engineer
Technical Screen
Coding & Algorithms
1
0

You are given the coordinates of n analysts and m field devices on a 2D grid, where 1 <= n <= 10 and n <= m <= 15. Each analyst must be assigned exactly one distinct device, and each device can be assigned to at most one analyst.

The cost of assigning analyst i at (ax[i], ay[i]) to device j at (dx[j], dy[j]) is the Manhattan distance:

|ax[i] - dx[j]| + |ay[i] - dy[j]|

Return the minimum possible total assignment cost after assigning a unique device to every analyst.

Design an algorithm efficient enough for the given constraints.

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Dark Alpha Capital•More Software Engineer•Dark Alpha Capital Software Engineer•Dark Alpha Capital Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 8,000+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.