Shadowfax Data Warriors Hiring Challenge | Optimal Hub Location & Priority Sorting Allocation
Question · Posted Jun 2026
Problem 1 - Optimal Hub Location Selection Problem Statement A logistics network contains N delivery destinations located along a straight highway. The position of each destination is given by the array: X[0], X[1], ..., X[N-1] Shadowfax wants to build exactly one dispatch hub at an integer coordinate H. The penalty cost of choosing location H is defined as: Penalty = |X[0] - H| + |X[1] - H| + ... + |X[N-1] - H| Find the minimum possible penalty cost. Constraints ...
The full answer & interview discussion are available to premium members.
Log in Create a free account