</>OfferRetriever
DashboardDiscuss
NEW
Halloween SalePremium questions, over 30% offUnlock all premium questions for over 30% off
$10.42$7.08/mo

--

:

--

:

--

:

--

Get this deal
Back to LinkedIn Questions

Distribution Center Placement

Medium

A logistics company is expanding its distribution network along a single highway. You are given an array of integers locations representing the coordinates of candidate hub sites. Find the optimal hub coordinate to place a distribution center that minimizes total shipping distance to all sites.

Return a two-element list [hub, totalDistance] where hub is chosen from locations to minimize totalDistance = sum of |hub - locations[i]| over all i. If multiple hub coordinates give the same minimum total distance, choose the smaller one. ...

Asked at:LinkedInMeta

More LinkedIn interview questions

All LinkedIn interview questions
OfferRetriever

Master technical interviews with real questions from top companies. Build your confidence and career.

PRODUCT
PricingDashboardDiscussOfferRetriever vs LeetCodeCompare
LEGAL

© 2026 Purple Business Holdings LLC. All rights reserved. See Terms of Service.