Reported August 2026
TikToksimulation

Space Station Shuttle Missions

Reported by candidates from TikTok's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.

Get StealthCoderRuns invisibly during the live TikTok OA. Under 2s to a working solution.
Founder's read

The TikTok OA reported in August 2026 dresses up a simple idea in sci-fi packaging. Shuttles, hubs, missions. Strip it and it's a greedy simulation with a clock. You hold a current time, find the earliest departure at or after it, add 100, then do the same on the way back. Repeat for the number of missions. If you've got an invite and 48 hours, this is the kind of problem you can lock down fast. And if the wording rattles you mid-assessment, StealthCoder is the invisible safety net that reads the screen and hands you a working solution.

The problem

A space-station network has two hubs, Alpha and Beta. Shuttle departures from Alpha to Beta are given by the sorted integer array alpha2beta, and departures from Beta to Alpha are given by the sorted integer array beta2alpha.
Every shuttle trip takes exactly 100 time units. Your journey starts at Alpha at time 0.
Complete missions missions. Each mission consists of traveling from Alpha to Beta and then returning from Beta to Alpha. For every leg, take the earliest shuttle whose departure time is at or after your arrival at that hub.
Return the time when all missions are complete. The schedules guarantee that every required leg can be completed.

Function
completeShuttleMissions(alpha2beta: int[], beta2alpha: int[], missions: int) → int

Examples
Example 1
alpha2beta = [0,200,500]
beta2alpha = [99,210,450]
missions = 1
return = 310
Take the Alpha-to-Beta shuttle at time 0 and arrive at Beta at time 100. The earliest available return shuttle departs at time 210, so the mission finishes at Alpha at time 310.
Example 2
alpha2beta = [0,300,700]
beta2alpha = [150,500,900]
missions = 2
return = 600
The first mission uses departures 0 and 150, finishing at time 250. The second uses departures 300 and 500, finishing at time 600.
Example 3
alpha2beta = [100,400]
beta2alpha = [200,500]
missions = 2
return = 600
After departing Alpha at 100, you arrive at Beta exactly when the shuttle at 200 departs. The second mission similarly uses departures 400 and 500, so all missions finish at time 600.

Constraints
alpha2beta and beta2alpha are sorted arrays of integer departure times.
Every Alpha-to-Beta and Beta-to-Alpha trip takes exactly 100 time units.
For every required leg, the corresponding schedule contains an available departure at or after the current time.

Reported by candidates. Source: FastPrep

Pattern and pitfall

The trick is that greedy is optimal. Taking the earliest available shuttle on every leg can never hurt, because arriving earlier never closes off a later departure. So you simulate. Keep a time variable starting at 0. For each mission, find the first value in alpha2beta that is >= time, set time to that value plus 100, then find the first value in beta2alpha that is >= time and add 100 again. Since both arrays are sorted, you can use two moving pointers or binary search. Pointers work because time only increases. The common pitfall is the boundary: a shuttle departing exactly at your arrival time counts, so use >= and not >. Example 3 tests exactly that. Also don't reset pointers between missions. If you blank on the loop under pressure, StealthCoder can supply the working code from the live screen.

The honest play: practice the pattern, and have StealthCoder ready for the one you didn't see coming.

If this hits your live OA

You can drill Space Station Shuttle Missions cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. Built for the candidate who saw this exact problem leak two days before his OA and wondered if anyone had a play.

Get StealthCoder

Related leaked OAs

⏵ The honest play

You've seen the question. Make sure you actually pass TikTok's OA.

TikTok reuses patterns across OAs. Built for the candidate who saw this exact problem leak two days before his OA and wondered if anyone had a play. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Space Station Shuttle Missions FAQ

How hard is the Space Station Shuttle Missions problem really?+

Easy to low-medium. There's no hidden graph or DP. It's a greedy simulation over two sorted arrays. Most of the difficulty is reading the statement carefully and getting the at-or-after boundary right. If you can write a loop with a pointer, you can solve it.

What's the trick to solving it?+

Always take the earliest shuttle at or after your current time. Arriving earlier never hurts, so greedy is optimal. Track one clock variable, advance it by 100 after each leg, and alternate between the two arrays for each mission.

Should I use binary search or two pointers?+

Either works. Two pointers is simpler and runs linear since time never goes backward, so each pointer only moves forward. Binary search adds a log factor per leg but is fine too. Pick whichever you can write without bugs.

What edge case trips people up?+

Equal times. If you arrive at Beta at time 100 and a shuttle departs at 100, you can board it. Use >= when searching. Example 3 in the TikTok problem covers this, so test it before submitting.

How do I prepare in 48 hours for this kind of TikTok OA question?+

Practice a few greedy simulation problems with sorted arrays and pointer advancing. Write the loop by hand, run the three examples, and check boundary cases. Spend the rest of the time on timing and reading statements slowly.

Problem reported by candidates from a real Online Assessment. Sourced from a publicly-available candidate-aggregated repository. Not affiliated with TikTok.

OA at TikTok?
Invisible during screen share
Get it