Starlink Beam Planner
Updated
Problem statement
You are given the positions of users and satellites as three-dimensional vectors relative to the center of a spherical Earth at (0, 0, 0). Construct a set of satellite beams that serves at least minimumServed distinct users.
Function Contract
Implement planBeams. Return an integer matrix in which every row is [userIndex, satelliteIndex, color]:
userIndexandsatelliteIndexare zero-based.coloris one of1,2,3, or4.- The order of the returned rows does not matter.
Your assignment must satisfy all of the following rules:
- One beam per user: a user may appear in at most one returned row.
- User visibility: for user vector
Uand satellite vectorS, the angle betweenUandS - Umust be at most45degrees. - Satellite capacity: one satellite may serve at most
32users. - Frequency separation: consider two users assigned to the same satellite. If their beams use the same color, the angle between the vectors from that satellite to the two users must be at least
10degrees. - Coverage: the matrix must contain at least
minimumServedrows.
Any assignment satisfying these rules is accepted. It does not have to equal the reference output shown in an example, and it may serve more than minimumServed users.
Function
planBeams(users: double[][], satellites: double[][], minimumServed: int) → int[][]Examples
Example 1
users = [[1,0,0],[0,1,0]]satellites = [[2,0,0],[0,2,0]]minimumServed = 2return = [[0,0,1],[1,1,1]]User 0 is directly below satellite 0, and user 1 is directly below satellite 1. Both users are served, so the minimum of 2 is met.
Example 2
users = [[1,0,0],[0.996194698,0.087155743,0]]satellites = [[2,0,0]]minimumServed = 2return = [[0,0,1],[1,0,2]]The two beams are less than 10 degrees apart at satellite 0, so the reference plan gives them different colors. Any other feasible colors are also accepted.
Example 3
users = [[1,0,0],[0,1,0]]satellites = [[2,0,0]]minimumServed = 1return = [[0,0,1]]User 0 is visible from the satellite. Serving that user alone satisfies minimumServed = 1; user 1 may be omitted.
Constraints
1 <= users.length <= 5001 <= satellites.length <= 100- Every user and satellite entry contains exactly three finite coordinates.
- Every user and satellite vector is nonzero, and every coordinate has absolute value at most
10^9. 0 <= minimumServed <= users.length- At least one valid assignment serves
minimumServedusers.
More SpaceX interview questions
- DNA Sequence MatchOA · Seen Apr 2025
- Timestamped Telemetry Stream DifferencesPHONE SCREEN · Seen Sep 2026
- Number of IslandsPHONE SCREEN · Seen Aug 2026
- Number of Islands IIPHONE SCREEN · Seen Aug 2026
- Button Combination DetectorPHONE SCREEN · Seen Feb 2026
- Rocket Component CostONSITE INTERVIEW · Seen Aug 2025
- Pressure Chamber Linear InterpolationPHONE SCREEN · Seen Jun 2025
- Speed to Pressure LookupPHONE SCREEN · Seen Mar 2025
- Simplified Time-Based Key-Value StorePHONE SCREEN · Seen Nov 2023
- Find the Duplicate NumberONSITE INTERVIEW · Seen Jan 2021
Similar questions at other companies
- Maximize K-Element AND with an Increment BudgetAmazon · OA
- Split Array to Minimize the Largest SumInfosys · OAInfosys interview questions
- Split Array Largest SumAuxoAI · OA
- Delete and Freeze GameRubrik · OARubrik interview questions
- Lock CodeVisa · OAVisa interview questions
- Most Segments That Sort the ArrayRippling · OARippling interview questions
- Greedy Person-Cake Matching DistanceSnowflake · PHONE SCREENSnowflake interview questions
- Split Array to Minimize the Largest SumNation with NaMo · PHONE SCREEN
- Max Points on a LineUber · PHONE SCREENUber interview questions
- Maximize Fish over Limited HoursByteDance · PHONE SCREENByteDance interview questions
Interview reports that mention this question
- Cursor, SpaceX and xAI New Grad Interviews: 15 Experiences
- 2013–2026 SpaceX Full-Time OA / Interviews: 45 Experiences (Part 2 :)
- SpaceX Software Engineer OA and Interviews: 27 Experiences
- SpaceX Starlink Software Engineer Assessment: 1 Experience
- SpaceX Starlink Backend Engineer OA: 1 Experience
- SpaceX Starlink Full-Stack Engineer Phone Screen: 1 Experience