Skip to content
LeetQuant

Hard · Expected Value & Decision Theory · Numerical · ~10 min · #67

Tying Spaghetti into Loops

Real interview · Hudson River Trading

A bowl holds 100 strands of spaghetti. Repeatedly pick two free ends uniformly at random and tie them together, until no free ends remain.

What is the expected number of loops? Give a numerical answer.

Hints · 0 of 3 shown

Worked solution

Give the problem an honest attempt first, then reveal the full explanation.

Reported in interviews

  • Hudson River Trading· Algorithm DeveloperGlassdoor interview question

    Asked for n strands, with a follow-up on the probability of a single loop.

Candidate-reported and unverified; the firm may phrase it differently or no longer ask it. The wording here is our own paraphrase, and the solution was written and checked independently of any answers posted at the source.

Related questions

Concepts

Linearity of expectationIndicator variables

Relevant for

Quant ResearcherQuant TraderQuant Developer