Expected Rounds Until a Shopping-Cart Line Empties Under Random Transfers

Read the full interview experience this question came from →

Quick Overview

Markov chain expectation question in which two lines start with 6 and 7 shopping carts and each round one cart moves from a uniformly chosen line to a uniformly chosen line, possibly the same one. Asks for the expected number of rounds until a line is empty, testing random-walk modeling and hitting-time recursions.

Expected Rounds Until a Shopping-Cart Line Empties Under Random Transfers

Company: DRW

Role: Quantitative Researcher

Category: Statistics & Math

Difficulty: hard

Interview Round: Onsite

Two lines initially contain 6 and 7 shopping carts. In each round, one line is selected uniformly at random and one cart is removed from it; the cart is then returned to a line selected independently and uniformly at random, so it may go back to the line it came from. The process ends when either line is empty at the end of a round. What is the expected number of rounds? ```hint Find the one number that matters The total number of carts never changes. Describe the state with a single count, work out how that count can change in one round, and set up equations for the expected number of remaining rounds. ``` ### Constraints and Clarifications - Both lines are nonempty at the start of every round that is played, so a cart can always be removed from the selected line. - A round in which the cart returns to its original line still counts as a round. - Give an exact value. ### What a Strong Answer Covers - Reducing the two lines to a one-dimensional process with absorbing boundaries. - Correct one-round transition probabilities, including rounds that leave both lines unchanged. - Solving the expected hitting-time recursion with its boundary conditions. - A sanity check, such as a comparison with a walk that changes the counts every round. ### Follow-up Questions 1. What is the probability that the line that started with 6 carts is the one that empties? 2. How would the answer change if the removed cart were always returned to the other line? 3. Generalize the answer to lines that start with $a$ and $b$ carts.

Overview: Markov chain expectation question in which two lines start with 6 and 7 shopping carts and each round one cart moves from a uniformly chosen line to a uniformly chosen line, possibly the same one. Asks for the expected number of rounds until a line is empty, testing random-walk modeling and hitting-time recursions.

Read the full DRW Quantitative Researcher interview experience this question came from

|Home/Statistics & Math/DRW
DRW logo
DRW
Sep 13, 2026
hardQuantitative ResearcherOnsiteStatistics & Math
1
0

Two lines initially contain 6 and 7 shopping carts. In each round, one line is selected uniformly at random and one cart is removed from it; the cart is then returned to a line selected independently and uniformly at random, so it may go back to the line it came from. The process ends when either line is empty at the end of a round.

What is the expected number of rounds?

Constraints and Clarifications

  • Both lines are nonempty at the start of every round that is played, so a cart can always be removed from the selected line.
  • A round in which the cart returns to its original line still counts as a round.
  • Give an exact value.

What a Strong Answer Covers Guidance

  • Reducing the two lines to a one-dimensional process with absorbing boundaries.
  • Correct one-round transition probabilities, including rounds that leave both lines unchanged.
  • Solving the expected hitting-time recursion with its boundary conditions.
  • A sanity check, such as a comparison with a walk that changes the counts every round.

Follow-up Questions Guidance

  1. What is the probability that the line that started with 6 carts is the one that empties?
  2. How would the answer change if the removed cart were always returned to the other line?
  3. Generalize the answer to lines that start with aa and bb carts.
Loading comments...