FastPrepBus Riders After Many Stops
Problems/Bus Riders After Many Stops

Bus Riders After Many Stops

Jane Street logoJane Street● MediumFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in two Jane Street trading desk operations reports from the U.S., posted in 2017 and 2018. Both describe a phone round of math questions, but neither says which round the bus question came from. In the 2017 teaser, a share of the riders leaves the bus at each of three stops in a row and seven new riders board each time, and the candidate gives the count at the last stop. We read that report's shorthand for the share as three quarters. It gives no starting count. The 2018 report recalls only a vague bus question with riders boarding and leaving.

Our function takes the starting count, the fraction that leaves, the number who board and the number of stops. The starting count of 52 in example 1, rounding the leavers down to whole people, the limits and the second and third examples are ours.

Our version is about 75% the same as the reported question.

A bus starts with passengers riders and then makes stops stops. At every stop, first a fraction offNumerator / offDenominator of the riders on board get off, rounded down to a whole number of people. Then boarding new riders get on.

Return the number of riders on the bus after the last stop.

Function

passengersAfterStops(passengers: int, offNumerator: int, offDenominator: int, boarding: int, stops: int) → int

Examples

Example 1

passengers = 52offNumerator = 3offDenominator = 4boarding = 7stops = 3return = 10

At stop 1, 39 of the 52 riders get off and 7 get on, leaving 20. At stop 2, 15 get off and 7 get on, leaving 12. At stop 3, 9 get off and 7 get on, leaving 10.

Example 2

passengers = 100offNumerator = 1offDenominator = 2boarding = 10stops = 1000000000return = 21

The count goes 100, 60, 40, 30, 25, 23, 22, 21. At 25 half is 12.5, so 12 get off. Once there are 21 riders, 10 get off and 10 get on, so the count stays at 21 for every later stop.

Example 3

passengers = 9offNumerator = 1offDenominator = 3boarding = 0stops = 2return = 4

At stop 1, 3 of 9 get off, leaving 6. At stop 2, 2 get off, leaving 4. Nobody gets on.

Constraints

  • 0 <= passengers <= 109
  • 1 <= offDenominator <= 100
  • 1 <= offNumerator <= offDenominator
  • 0 <= boarding <= 106
  • 1 <= stops <= 109

More Jane Street Phone Screen questions

  • Maximum-Scoring Consecutive Tree LevelsPHONE SCREEN · Seen Nov 2026
  • Tree Selection and VisibilityPHONE SCREEN · Seen Nov 2026
  • Load/Store Arithmetic InterpreterPHONE SCREEN · Seen Oct 2026
  • Instrument Stack Language JumpsPHONE SCREEN · Seen Oct 2026
  • Run a Stack Language InterpreterPHONE SCREEN · Seen Oct 2026
  • Positive-Integer Expression EvaluationPHONE SCREEN · Seen Oct 2026
  • Add Two Integers Given as StringsPHONE SCREEN · Seen Sep 2026
  • Angle Between Clock HandsPHONE SCREEN · Seen Jul 2026
  • Route Length From Two CyclistsPHONE SCREEN · Seen Jul 2026
  • Sort TradesPHONE SCREEN · ONSITE INTERVIEW · Seen Jul 2026

Similar questions at other companies

  • Constant-Time Weighted Pick with an Alias TableEtched · PHONE SCREEN
  • Monthly Calendar with Custom Week StartStripe · PHONE SCREENStripe interview questions
  • Fractional Share Inventory FlatteningRobinhood · PHONE SCREEN · ONSITE INTERVIEWRobinhood interview questions
  • Logistic Regression DiagnosticsLinkedIn · PHONE SCREENLinkedIn interview questions
  • Evenly Schedule Vehicle InspectionsAmazon · PHONE SCREEN
  • Implement Cross-Entropy LossOpenAI · PHONE SCREENOpenAI interview questions
  • Cumulative No-Intercept Regression BetasCitadel · PHONE SCREENCitadel interview questions
  • Add Signed Character ArraysByteDance · PHONE SCREENByteDance interview questions
  • Per-Segment SpeedingOnePay · PHONE SCREENOnePay interview questions
  • Automation Pipeline, Part 2: Stage WorkersPlaid · PHONE SCREENPlaid interview questions

Interview reports that mention this question

  • Jane Street TDO Phone Math Round: 26 Experiences (Part 9 of 10)
  • Jane Street TDO Excel and VBA Test: 23 Experiences (Part 8 of 10)

Jane Street interview experiences

  • Jane Street TDO UK and Hong Kong: 22 Experiences (Part 10 of 10)
  • Jane Street TDOE US Final Round: 11 Experiences (Part 5 of 10)
  • Jane Street TDOE UK Phone Screen: 15 Experiences (Part 4 of 10)
  • Jane Street TDOE UK Coding Round: 15 Experiences (Part 3 of 10)
All Jane Street interview questionsSee Jane Street hiring insights
Saved
class Solution {
    public int passengersAfterStops(int passengers, int offNumerator, int offDenominator, int boarding, int stops) {
      // Write your code here.
    }
}
Checking account…