FastPrepCatching the Bus to the Movie
Problems/Catching the Bus to the Movie

Catching the Bus to the Movie

Susquehanna International Group (SIG) logoSusquehanna International Group (SIG)● EasyINTERNNEW GRADPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Four separate reports from SIG recruiter, HR and phone screens for quant roles, from late 2024 to early 2026, mention this question, and two of them give the full setup. Bob and a bus each reach the stop at a random time in the same hour. The bus waits 10 minutes, the ride takes 20 minutes, and you find the chance that Bob reaches a movie that starts when the hour ends. One author explains that the bus always stays the full 10 minutes, whether or not Bob gets on, and gives the answer 5/24. The other reports do not spell out this rule, and readers who assumed the bus leaves as soon as Bob boards got about 0.32.

Here, the bus always stays the full wait. Bob's window, the bus's window, the wait, the ride time and the movie start are whole-minute inputs. Both windows start at the same moment. Answers within 10^-9 (absolute or relative) are accepted. The interview case is the first example, and the editorial also works out the other reading.

Our version is about 85% the same as the reported questions.

Bob wants to catch a movie. He will take a bus from a bus stop to the cinema.

Measure time in minutes, starting at 0. Bob reaches the stop at a uniformly random time between 0 and bobWindow. The bus reaches the stop at a uniformly random time between 0 and busWindow. The two times are independent.

The bus always stays at the stop for exactly busWait minutes and then leaves, whether or not Bob is on it. Bob gets on if he reaches the stop before the bus leaves. If he gets there first, he waits for the bus. The ride to the cinema takes rideTime minutes.

The movie starts at time movieStart. Return the probability that Bob gets on the bus and reaches the cinema no later than movieStart. Your answer is accepted if its absolute error or its relative error is at most 10^-9.

Function

onTimeProbability(bobWindow: int, busWindow: int, busWait: int, rideTime: int, movieStart: int) → double

Examples

Example 1

bobWindow = 60busWindow = 60busWait = 10rideTime = 20movieStart = 60return = 0.20833333333333334

This is the interview case: both arrive between minute 0 and minute 60, the bus waits 10 minutes, the ride takes 20, and the movie starts at minute 60.

The bus must reach the cinema by minute 60, so it must leave by minute 40. It leaves 10 minutes after it arrives, so it must arrive by minute 30.

If the bus arrives at minute u (with u at most 30), Bob gets on when he arrives by minute u + 10. On a 60 by 60 square of (Bob, bus) arrival times, these good points form a region of area 750, so the answer is 750 / 3600 = 5/24, about 0.2083.

Example 2

bobWindow = 60busWindow = 60busWait = 10rideTime = 20movieStart = 40return = 0.041666666666666664

Now the movie starts at minute 40, so the bus must leave by minute 20 and arrive by minute 10.

For a bus at minute u from 0 to 10, Bob has u + 10 good minutes. The good area is 10 × 10 / 2 + 10 × 10 = 150, so the answer is 150 / 3600 = 1/24.

Example 3

bobWindow = 30busWindow = 60busWait = 0rideTime = 15movieStart = 75return = 0.75

The bus does not wait at all, so Bob must be at the stop before the bus. Any bus arrival works for the movie, because 60 + 15 <= 75.

Half the time the bus comes after minute 30, and then Bob, who arrives by minute 30, is always there first. Otherwise the bus comes at minute u below 30 and Bob is first with chance u / 30, which is 1/2 on average. The answer is 1/2 + 1/2 × 1/2 = 3/4.

Constraints

  • 1 <= bobWindow, busWindow <= 10^4
  • 0 <= busWait, rideTime <= 10^4
  • 0 <= movieStart <= 4 * 10^4

More Susquehanna International Group (SIG) Phone Screen questions

  • Dice Sum That Is a Multiple of mPHONE SCREEN · Seen Nov 2026
  • Find Median from Data StreamPHONE SCREEN · Seen Nov 2026
  • Painting Arcs to Nearest Neighbors on a CirclePHONE SCREEN · Seen Sep 2026
  • Filter Movies by Inclusive Year RangePHONE SCREEN · Seen Jul 2026
  • Best Single Reroll for Five DicePHONE SCREEN · Seen Feb 2026
  • Two Dice Summing to a TargetPHONE SCREEN · Seen Jan 2026
  • Median of Uniform Draws in an IntervalPHONE SCREEN · Seen Oct 2025
  • One Number Is the Average of the Other TwoPHONE SCREEN · Seen Jun 2025
  • Which Coin Pattern Shows Up FirstPHONE SCREEN · Seen May 2025
  • Random Points Inside One ArcPHONE SCREEN · Seen Jan 2025

Similar questions at other companies

  • Range of a Third CorrelationTower Research Capital · PHONE SCREEN
  • Three Points in a Semicircle: Monte Carlo EstimateSquarepoint Capital · PHONE SCREENSquarepoint Capital interview questions
  • Union Area of Two RectanglesDocuSign · PHONE SCREENDocuSign interview questions
  • Intersection of Two RectanglesFigma · PHONE SCREENFigma interview questions
  • Light Source Hits: Sample, Compare, and FitOpenAI · PHONE SCREENOpenAI interview questions
  • Max Points on a LineUber · PHONE SCREENUber interview questions
  • Count Axis-Aligned and Rotated SquaresGoogle · PHONE SCREENGoogle interview questions
  • Best-Fit Plane Normal from 3D PointsThe Voleon Group · PHONE SCREEN
  • Meeting of Points Moving Toward Initial SuccessorsThe Walt Disney Company · PHONE SCREENThe Walt Disney Company interview questions
  • Maximum Visible DronesAnduril · PHONE SCREENAnduril interview questions

Interview reports that mention this question

  • SIG Quant Research Intern Interviews: 60 Experiences
  • SIG Quant Researcher New Grad Interviews: 49 Experiences

Susquehanna International Group (SIG) interview experiences

  • SIG Quant Researcher Experienced Hire Interviews: 11 Experiences
  • SIG Quant Researcher Intern Interviews: 1 Experience
  • SIG Quant Second-Round Tech Screen: 1 Experience
All Susquehanna International Group (SIG) interview questionsSee Susquehanna International Group (SIG) hiring insights
Saved
class Solution {
    public double onTimeProbability(int bobWindow, int busWindow, int busWait, int rideTime, int movieStart) {
        // Write your code here.
    }
}
Checking account…