Reported June 2024
Ubersimulation

Bus Time

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

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

You've got an Uber OA coming up and "Bus Time" is on the board. This one trips candidates because it looks simple but the edge cases around timing, schedules, and arrival windows are brutal. The pattern isn't immediately obvious from the title, which is exactly why Uber includes it. You need to think about how buses arrive, when they depart, and what "time" actually means in the context of transit. StealthCoder is your safety net if you blank on the implementation during the live assessment.

Pattern and pitfall

Bus Time is fundamentally a simulation problem wrapped in a scheduling layer. You're tracking state changes over time, usually iterating through events (bus arrivals, departures, passenger boarding) and applying rules about capacity, wait times, or scheduling constraints. The trap is assuming a greedy or naive approach works when you actually need to simulate the full timeline. Common mistakes include not handling simultaneous events correctly, forgetting to track passenger state, or miscalculating when a bus fills or departs. The tricky part is that the problem often hides the real constraint until you work through an example. During the live OA, if you're stuck on the simulation loop or the event ordering, StealthCoder can feed you the exact state transitions you need to code.

If this hits your live OA and you blank, StealthCoder solves it in seconds, invisible to the proctor.

If this hits your live OA

You can drill Bus Time 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 by an Amazon engineer who would have shipped this the night before his JPMorgan OA if he'd had it.

Get StealthCoder

Related leaked OAs

⏵ The honest play

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

Uber reuses patterns across OAs. Built by an Amazon engineer who would have shipped this the night before his JPMorgan OA if he'd had it. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Bus Time FAQ

Is this a pure simulation or something harder underneath?+

It's simulation first, but the hard part is the state machine. You're tracking which passengers board which bus, when buses arrive and leave, and calculating total time. Don't overthink the algorithm - focus on getting the simulation right and the answer falls out.

What's the most common mistake candidates make on Bus Time?+

Handling the timeline incorrectly. Candidates either simulate minute-by-minute (works but slow) or miss that buses can arrive while passengers are boarding. Read the problem constraints carefully about bus frequency and passenger arrival patterns.

Do I need to optimize for performance or just correctness?+

Start with correctness. If the OA has large inputs, you may need to jump to discrete time events instead of iterating every minute. But nail the logic first, then optimize only if you hit a timeout.

How do I prep for this in 24-48 hours if I've never seen it?+

Trace through a manual example by hand. Pick 3-4 passengers, 2 buses, and simulate step by step on paper. That's faster than coding blind. Understanding the flow beats memorizing patterns.

Is this the kind of problem where there's a trick or a formula?+

No. It's pattern recognition on simulation and careful state tracking. There's no shortcut. Your edge case handling and loop logic will determine pass or fail.

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

OA at Uber?
Invisible during screen share
Get it