Skip to main content
All Questions

Place K servers in data centers to maximize the minimum distance between them.

Unlock detailed company stats for this questionUpgrade

An investment bank operates N data centers connected along a high-speed fiber network. The position of each data center is its distance in kilometers from the bank's primary exchange. The bank wants to deploy exactly K order-routing servers in these data centers, placed as far apart as possible to improve fault tolerance and reduce the impact of localized network failures.

Given an integer array positions, where positions[i] is the location of the ith data center, and an integer K, return the largest possible minimum distance between any two deployed servers.

Example: positions = [1, 2, 4, 8, 9]; K = 3 gives 3.

Format · Technical interview.

Community answers

No answers contributed by the community yet.

Related courses

Course

Software Engineering Interview Prep

Land your dream software engineering role at Google, Amazon, Microsoft, Meta, Apple, and other top companies. Learn from mock interviews, frameworks, and advice from senior candidates—practice data structures, algorithms, system design, people management, behavioral interviews, and more.

Course

System Design Interviews

Learn how to answer the latest system design questions across product, infrastructure, and AI domains. Features in-depth video examples, written breakdowns, and helpful reference patterns. Watch senior engineers and managers answer these questions in mock interview videos.