Fewest Starlink Satellites to Cover a Terminal for a Session
Last updated: November 29, 2026
Quick Overview
A user terminal can see satellite `i` during `[start_i, end_i]`. Choose the fewest satellites whose visibility windows together cover `[0, T]` without a break, or report that coverage is impossible.
Spacex
November 29, 20260
0
0 solved
A user terminal can see satellite `i` during `[start_i, end_i]`. Choose the fewest satellites whose visibility windows together cover `[0, T]` without a break, or report that coverage is impossible.
Starlink terminals hand off between satellites every few seconds, and fewer handoffs means fewer chances to drop packets. This greedy interval covering problem fits a SpaceX Starlink software screen; the interviewer checks that you can justify the greedy choice and handle the impossible case.
What the Interviewer Expects
- Recognize this as interval covering and propose the farthest-reach greedy
- Argue why picking the window that reaches farthest is never worse (exchange argument)
- Detect a gap where no window starts at or before the covered point
- Return both the count and the chosen windows
- Achieve O(n log n) and explain the single pointer sweep
Key Topics to Cover
How to Approach This
- Clarify input constraints and edge cases before writing code.
- Walk through your approach verbally and confirm with the interviewer before coding.
- Start with a brute force solution, then optimize. Mention time and space complexity.
- Test your solution with examples, including edge cases like empty input or duplicates.
- Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
- Each handoff costs a fixed penalty and each satellite has a signal quality score. How does the objective change and does greedy still work?
- What if a handoff needs the next satellite to overlap the current one by at least 2 seconds?
- How would you recompute the plan when a satellite is suddenly marked unavailable?
- How would this scale to scheduling one million terminals against the same constellation?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
Inputs: list of closed windows (start, end) and horizon T. Windows that touch are enough for continuity (switching is instant). Output (count, chosen) or (-1, []). T = 0 needs zero satellite...
High-Level Design
Sort by start. Maintain covered, the time up to which we already have service. Among all windows starting at or before covered, pick the one ending farthest; jump covered to that end. If no cand...