FastPrepMaximize the Minimum Cone Distance
Problems/Maximize the Minimum Cone Distance

Maximize the Minimum Cone Distance

Sumo Logic logoSumo Logic● MediumFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a Sumo Logic phone screen. The source gives the goal and two examples. It does not give number limits or a function signature. Our version is about 98% the same as the reported question.

You are given n distinct coordinates in the integer array positions. Choose exactly m coordinates at which to place cones.

The distance between two cones is the absolute difference between their coordinates. Return the largest possible value of the minimum distance between every pair of consecutively placed cones after the chosen coordinates are sorted.

Function

maximizeMinimumConeDistance(positions: int[], m: int) → int

Examples

Example 1

positions = [1,2,8,4,9]m = 3return = 3

Choosing coordinates [1,4,8] gives consecutive gaps 3 and 4, so its minimum gap is 3. No placement has a larger minimum gap.

Example 2

positions = [1,5,8,4,9,12,19]m = 3return = 8

Choosing [1,9,19] gives gaps 8 and 10, so the answer is 8.

Constraints

  • 2 <= positions.length <= 6000.
  • 2 <= m <= positions.length.
  • 0 <= positions[i] <= 10^9.
  • All coordinates in positions are distinct.

Similar questions at other companies

  • Aggressive CowsAmazon · PHONE SCREEN
  • Maximize Fish over Limited HoursByteDance · PHONE SCREENByteDance interview questions
  • Minimize Maximum Group DifferenceDRW · OADRW interview questions
  • Minimum-Cost Solar Rooftop AllocationDeloitte · OADeloitte interview questions
  • Maximize Number of Produced CarsMicrosoft · OAMicrosoft interview questions
  • Aggressive CowsPeopleStrong · OAPeopleStrong interview questions
  • Spread Cows Across StallsExpedia · OAExpedia interview questions
  • Count Winning Dice Face PairsGoogle · PHONE SCREEN · ONSITE INTERVIEWGoogle interview questions
  • Fair Capped Money DistributionGusto · PHONE SCREEN · ONSITE INTERVIEWGusto interview questions
  • Tennis Court SchedulingAtlassian · PHONE SCREEN · ONSITE INTERVIEWAtlassian interview questions
See Sumo Logic hiring insights
Saved
class Solution {
    public int maximizeMinimumConeDistance(int[] positions, int m) {
        // Return the largest feasible minimum gap.
    }
}
Checking account…