QuantPrep
QUANT INTERVIEW PROBLEM·optimal-stopping·difficulty 4

The Secretary Problem

Reject the first 1/e of candidates, then take the best so far. The classic optimal-stopping problem and its famous 1/e answer.

also known as: sultan's dowry problem · optimal stopping problem · 1/e stopping rule

PROBLEM

You interview n candidates in random order. After each interview you must immediately decide: hire (ending the process) or reject forever. Goal: maximise the probability of hiring the best candidate overall. What's your optimal strategy, and what's the probability of success as n → ∞?

ANSWER

Reject the first n/e candidates; then accept the first one who exceeds every prior candidate. P(success) → 1/e ≈ 36.8%.

CANONICAL SOLUTION

Let k be the number of candidates you reject before switching to 'accept the first best-so-far'. Given this rule, we win if and only if the best candidate appears at position i > k AND the best among the first i-1 candidates appeared in the first k positions (so we haven't accepted anyone yet when the true best arrives).

For fixed i > k, the probability that the best candidate is at position i is 1/n, and (conditional on the best being at i) the probability that the best of the first i-1 was in the first k is k/(i-1). Summing:

P(wink)=i=k+1n1nki1=kni=k+1n1i1P(\text{win} \mid k) = \sum_{i=k+1}^{n} \frac{1}{n} \cdot \frac{k}{i-1} = \frac{k}{n} \sum_{i=k+1}^{n} \frac{1}{i-1}

As n → ∞, with x = k/n, this tends to xln(x)-x \ln(x). Maximising over x: take the derivative, set to zero: ln(x)+1=0\ln(x) + 1 = 0, so x=1/ex = 1/e. At the optimum, success probability is also 1eln(1e)=1/e0.368-\tfrac{1}{e} \ln(\tfrac{1}{e}) = 1/e ≈ 0.368.

AI ALTERNATIVE FRAMING

Think of it as balancing two error types. If you reject too few candidates at the start, you don't know what 'great' looks like in this particular applicant pool, so you'll accept an early mediocre candidate who happens to be the best-so-far of a small prefix. If you reject too many, the actual best candidate has likely already passed — and you'll end up with whoever happens to come last. The 1/e split minimises the sum of these two errors. Intuitively, e arises because you need enough samples to calibrate the distribution, and the information-theoretic sweet spot lies at e1e^{-1} of the stream.

On QuantPrep, every practice problem gets an AI-generated alternative explanation like this — tailored to the canonical solution, streaming live.

COMMON VARIATIONS

Payoff variant

Instead of a binary 'hired the best or not' payoff, your payoff equals the rank of the person you hired (or their actual 'quality' score from a known distribution).

The optimal stopping ratio changes — rejecting fewer candidates becomes optimal since partial credit matters.

Multiple picks

You can hire up to k candidates instead of one. Maximise the probability that your k picks include the true best.

The threshold strategy generalises: reject an initial pool of size k*(n), then accept the next k best-so-far candidates.

Known distribution

You know the distribution that generates candidate qualities (e.g. uniform(0, 1)). Maximise expected hired quality.

Reduces to a standard dynamic programming problem; threshold policy solvable in closed form.

FIRMS THAT ASK THIS

TECHNIQUE

Optimal Stopping

When to stop and take the offer — the secretary problem and its cousins.

FREE QUANT BRAINTEASERS WEEKLY

Not ready to sign up? Get 5 hand-picked quant interview problems every week. No spam, unsubscribe any time.

TRY A PROBLEM NOW · NO SIGNUP

#042 · optimal_stoppingdifficulty 4

In the classical secretary problem, as n → ∞, what fraction should you reject outright before accepting the next best-so-far candidate?

LIVE DEMO · NO SIGNUP

FAQ

Why does 1/e keep showing up?

It comes from maximising xln(x)-x \ln(x), which arises from the success-probability expression. More deeply, ee is the unique base that makes ddxax=ax\tfrac{d}{dx} a^x = a^x at x=0x = 0, which shows up whenever you're optimising logarithmic quantities.

Is this problem ever asked literally at quant firms?

Yes — Jane Street and SIG occasionally ask it verbatim, but more often they'll ask a variant (different payoff, multiple picks, noisy observations) to probe whether you understand the mechanism or just memorised the answer.

How does this connect to real trading?

Order execution algorithms, option exercise decisions, and position-sizing under uncertainty are all optimal-stopping problems. The secretary problem is the cleanest warm-up for that family.

RELATED PROBLEMS

Practice variants of this problem

400+ problems on QuantPrep, including variants of the secretary problem and every technique it draws on.

Start practicing free