Representative quant-interview questions tagged to D. E. Shaw, concentrated in probability, combinatorics, and brainteasers. Preview a free set below, then drill the full bank with hints and worked solutions.
1,229 D. E. Shaw questions · 74 free to preview · 2,516 problems total
How many rolls of a fair N-sided die are required, on average, to observe every face at least once? Compute the value for N=100, rounded to the nearest integer.
Solution
Coupon Collector's Problem
High-level idea. Decompose the total waiting time into independent geometric stages, then apply linearity of expectation.
Stage decomposition
Let T be the total number of rolls of a fair N-sided die needed to observe every face at least once. Define stage k (k=1,…,N) as the period that begins the moment the (k−1)-th distinct face was first seen and ends when the k-th distinct face is first seen. Writing Tk for the number of rolls in stage k,
T=T1+T2+⋯+TN.
Distribution of each stage
At the start of stage k, exactly k−1 faces have been observed. Each roll independently reveals a previously unseen face with probability
pk=NN−(k−1)=NN−k+1.
Hence Tk∼Geometric(pk) (number of trials until first success), so
E[Tk]=pk1=N−k+1N.
Closed-form expected value
By linearity of expectation,
E[T]=k=1∑NN−k+1N.
Reindexing with j=N−k+1 (as k runs 1→N, j runs N→1):
E[T]=Nj=1∑Nj1=N⋅HN,
where HN=j=1∑Nj1 is the N-th harmonic number.
Numerical evaluation for N=100
Using the Euler–Maclaurin asymptotic expansion
HN=lnN+γ+2N1−12N21+120N41−⋯,
with γ=0.57721566490153… (Euler–Mascheroni constant):
A fair coin is flipped repeatedly until the first heads appears. The payout is 2n dollars if the first heads occurs on the nth toss. Determine the fair value of this game. If the expected value is infinite, output −1.
Solution
Let N be the number of coin flips until the first heads appears. Since the coin is fair, N follows a geometric distribution with success probability 1/2: P(N=n)=(1/2)n for n=1,2,3,… (the first n−1 flips are tails and the nth flip is heads). The payout when N=n is 2n dollars. The expected value of the payout is
A fair standard die is rolled until two consecutive 1s first appear. Find the expected number of rolls.
Solution
High-level idea
Model the process as a Markov chain with two transient states tracking the current "run" of consecutive 1s. Set up first-step equations and solve the 2×2 linear system.
States and equations
Let p=61 be the probability of rolling a 1. Define:
S0: start, or the last roll was not a 1.
S1: the last roll was a 1 (one consecutive 1 in progress).
Let μ0,μ1 be the expected number of additional rolls needed to reach absorption (two consecutive 1s) from each state.
From S0 — one roll is used; with probability 61 we move to S1, with probability 65 we remain in S0:
μ0=1+61μ1+65μ0.
From S1 — one roll is used; with probability 61 we finish (0 more rolls), with probability 65 we return to S0:
Three independent random variables X, Y, and Z are each uniformly distributed on [0,1]. What is the probability that X, Y, and Z are the side lengths of a valid triangle?
Solution
Idea
Work with the complement: a triple fails the triangle inequality if and only if one side is at least as large as the sum of the other two. The three failure events turn out to be mutually exclusive, so the failure probability is simply 3P(A) for any one of them.
Setup
Let X,Y,Z∼iidUniform[0,1]. Define the failure events
A={X+Y≤Z},B={X+Z≤Y},C={Y+Z≤X}.
Mutual Exclusivity of A, B, C
Suppose A∩B occurs: X+Y≤Z and X+Z≤Y. Adding these inequalities gives 2X+Y+Z≤Y+Z, hence X≤0. Since X≥0 a.s., this forces X=0, an event of probability zero. By symmetry, every pairwise intersection has measure zero, so A, B, C are mutually exclusive a.s. Combined with symmetry of the joint distribution,
P(A∪B∪C)=P(A)+P(B)+P(C)=3P(A).
Computing P(A)
Condition on Z=z. The event {X+Y≤z} within [0,1]2 traces the right triangle {x≥0,y≥0,x+y≤z}, which has area z2/2. Therefore
Eight points are placed on a circle. All chords connecting every pair of points are drawn. Four chords are then chosen uniformly at random. What is the probability that these four chords form a convex quadrilateral?
Solution
We have 8 points on a circle, so there are (28)=28 chords in total. Choosing 4 chords uniformly at random gives (428) equally likely outcomes.
For the 4 chords to form a convex quadrilateral, their union must be exactly the boundary of that quadrilateral. Because the points lie on a circle, any 4 distinct points determine a convex quadrilateral whose sides are the chords connecting consecutive points in cyclic order. Thus a favorable set of 4 chords corresponds precisely to choosing 4 of the 8 points and taking the four boundary chords of that set. There are (48)=70 ways to choose the points, and each yields exactly one favorable 4‑chord set. No other set of 4 chords can form a convex quadrilateral, since any quadrilateral must have four distinct vertices, and on a circle the only non‑self‑intersecting 4‑cycle on four points is the boundary cycle.
A class contains 15 boys and 10 girls. The students line up in a row uniformly at random. What is the expected number of adjacent boy-girl pairs? For example, the lineup BGBBGGGBGGBBBBGBGBBGBBGBB has 14 such adjacent pairs.
Solution
We have 15 boys and 10 girls, totaling 25 students. The students line up uniformly at random. We want the expected number of adjacent positions where one is a boy and the other is a girl (order BG or GB).
Let X be the number of adjacent boy-girl pairs. For each adjacent pair of positions (i,i+1) with i=1,…,24, define an indicator Ii that the two students at those positions are of opposite sexes. Then X=∑i=124Ii, and by linearity of expectation,
E[X]=i=1∑24E[Ii]=i=1∑24Pr(positions i and i+1 are opposite sexes).
By symmetry, the probability is the same for every adjacent pair; denote it by p. Hence E[X]=24⋅p.
Now compute p. There are 25×24 equally likely ordered assignments of two distinct students to the two positions. Favorable cases are (boy, girl) and (girl, boy). There are 15×10=150 ways to choose a boy then a girl, and 10×15=150 ways to choose a girl then a boy, for a total of 300 favorable ordered pairs. Thus
p=25×24300=600300=21.
Alternatively, Pr(boy then girl)=2515⋅2410=41, and Pr(girl then boy)=2510⋅2415=41, so p=41+41=21.
Priya and Theo each raise ants. Priya has 40 ants and Theo has 80 ants. They stand at opposite ends of an infinitesimally wide string and release all their ants onto it simultaneously. All ants move at the same constant speed. Whenever two ants meet, they both reverse direction. Each ant moves only forward. Let x be the number of ants that reach Priya and y the number that reach Theo. Compute x−y.
Solution
The key insight is that when two ants meet and reverse direction, the system is equivalent to the ants passing through each other without interaction, because the ants are indistinguishable. Under this "pass-through" model, each ant simply continues in its original direction forever. Therefore, the number of ants that reach Priya's end equals the number of ants that were initially moving leftward (toward Priya), and the number that reach Theo's end equals the number initially moving rightward (toward Theo).
Initially, all 40 ants at Priya's end move rightward (toward Theo), and all 80 ants at Theo's end move leftward (toward Priya). Under the pass-through equivalence, the ants that reach Priya are those that started at Theo's end and moved leftward: 80 ants. The ants that reach Theo are those that started at Priya's end and moved rightward: 40 ants. Thus x=80, y=40, and
x−y=80−40=40.
More formally, let x be the number reaching Priya and y the number reaching Theo. Under the pass-through model, each ant's trajectory is a straight line from its start to the opposite end. Since all ants move at the same speed, the number reaching each end is exactly the number that started at the opposite end. Hence x=80, y=40, and the difference is 40.
On a sheet of paper are 100 statements. The first reads, "at most 0 of these 100 statements are true." The second reads, "at most 1 of these 100 statements are true." In general, the nth statement says, "at most n−1 of these 100 statements are true." How many statements are true?
Solution
Let the statements be numbered 1,2,…,100. Statement k says: "at most k−1 of these 100 statements are true."
Let T be the total number of true statements. For statement k to be true, we must have T≤k−1; for it to be false, T>k−1. Hence statement k is true exactly when k≥T+1.
Thus the true statements are those with indices T+1,T+2,…,100. The number of such statements is 100−T. But this number must equal T itself, because T is the total number of true statements. Therefore:
T=100−T⟹2T=100⟹T=50.
Check: If T=50, then statements 51 through 100 are true (50 statements). Statement 51 says "at most 50 are true" — true because exactly 50 are true. Statement 50 says "at most 49 are true" — false because 50>49. All statements 1 through 49 are false because each claims "at most k−1 are true" with k−1≤48, but 50>k−1. All statements 52 through 100 are true because each claims "at most k−1 are true" with k−1≥51, and 50≤k−1. Hence exactly 50 statements are true, consistent with T=50.
Consider a drunkard starting one pace from a precipice. On each move he steps toward the edge with chance 1/3 and away with chance 2/3; moves are independent. Determine the probability that he never goes over the edge, i.e., he escapes.
Solution
Let qk be the probability that the drunkard eventually steps onto the precipice (ruin) when he is currently k paces from the edge (k≥0). The precipice is at k=0, so q0=1. We want the survival probability 1−q1.
For k≥1, condition on the first step:
qk=31qk−1+32qk+1.
Multiply by 3 and rearrange to obtain the homogeneous linear recurrence
2qk+1−3qk+qk−1=0.
The characteristic equation is 2r2−3r+1=0, which factors as (2r−1)(r−1)=0, giving roots r=1 and r=21. Hence
qk=A+B(21)k.
Boundary conditions.
At k=0: q0=1⟹A+B=1.
As k→∞, the walk has a positive drift away from the edge (each step has expected change +31). Therefore the probability of ever hitting 0 from far away tends to 0, i.e. limk→∞qk=0. This forces A=0, and consequently B=1.
Thus qk=(21)k. In particular, the ruin probability starting one pace away is q1=21. The probability that he never goes over the edge is
On a magic island covered in grass live 100 tigers and 1 sheep. The tigers can eat grass but prefer sheep. Each time, only one tiger may eat the sheep, and after doing so it turns into a sheep itself. All tigers are intelligent, perfectly rational, and value survival. Will the sheep be eaten?
Solution
We determine the outcome by backward induction on the number of tigers, n. The key observation is that a tiger will eat the sheep only if doing so guarantees its own survival after it turns into a sheep.
n=1: The lone tiger eats the sheep, becomes a sheep, and faces no remaining tigers. It survives, so the sheep is eaten.
n=2: If a tiger eats the sheep, it becomes a sheep, leaving one tiger and one sheep. By the n=1 case, that remaining tiger will eat the new sheep, so the first tiger would die. Since tigers value survival, neither will eat. The sheep survives.
n=3: If a tiger eats, it becomes a sheep, leaving two tigers and one sheep. From n=2, the two tigers will not eat the sheep (they would die), so the eating tiger survives. Hence some tiger will eat, and the sheep is eaten.
n=4: Eating leads to the n=3 case, where the sheep is eaten, so the eating tiger would die. No tiger eats; the sheep survives.
Continuing this logic, the sheep is eaten if and only if n is odd. For n=100 (even), no tiger will eat the sheep.
Three assets A, B, C have correlations ρAB=0.9 and ρBC=0.8. Can ρAC=0.1?
Solution
A correlation matrix must be positive semidefinite (PSD). For three assets with pairwise correlations ρAB=0.9, ρBC=0.8, and a candidate ρAC=0.1, we check whether the 3×3 correlation matrix
R=10.90.10.910.80.10.81
is PSD. A necessary and sufficient condition for a 3×3 symmetric matrix with unit diagonal is that all principal minors are nonnegative. The 1×1 and 2×2 minors are clearly nonnegative, so the key condition is det(R)≥0.
Sandy has 5 pairs of socks in a drawer, each pair a distinct color. On Monday, she randomly picks two socks from the 10 total; on Tuesday, she picks two from the remaining 8; on Wednesday, she picks two from the remaining 6. What is the probability that Wednesday is the first day she selects a matching pair?
Solution
Let M, T, W be the events that Monday, Tuesday, Wednesday produce a matching pair, respectively. We want
P(Mc∩Tc∩W)=P(Mc)P(Tc∣Mc)P(W∣Mc∩Tc).
1. P(Mc). Total ways to choose 2 socks from 10: (210)=45. Matching pairs: 5 (one per color). So P(M)=5/45=1/9, hence
P(Mc)=1−91=98.
2. P(Tc∣Mc). After a non‑matching Monday, two socks of different colors are removed. The remaining 8 socks consist of 3 colors with 2 socks each and 2 colors with 1 sock each. Total pairs from 8: (28)=28. Only the three colors with 2 socks can produce a matching pair, so 3 matching pairs. Thus P(T∣Mc)=3/28 and
P(Tc∣Mc)=1−283=2825.
3. P(W∣Mc∩Tc). After Monday and Tuesday are both non‑matching, the composition of the remaining 6 socks depends on how Tuesday's non‑matching pair was formed. Starting from the Monday state (3 colors with 2 socks, 2 colors with 1 sock), Tuesday's non‑matching pair can be of three types:
Case A: Both socks from the 2-sock colors. Number of ways: (23)⋅2⋅2=12. Resulting state: 1 color with 2 socks, 4 colors with 1 sock. Probability of a match on Wednesday: (26)1=151.
Case B: One sock from a 2-sock color and one from a 1-sock color. Number of ways: 3⋅2⋅2⋅1=12. Resulting state: 2 colors with 2 socks, 2 colors with 1 sock, 1 color with 0 socks. Probability of a match on Wednesday: 152.
Case C: Both socks from the two 1-sock colors. Number of ways: 1. Resulting state: 3 colors with 2 socks, 2 colors with 0 socks. Probability of a match on Wednesday: 153=51.
Total non‑matching pairs on Tuesday: 12+12+1=25, so the conditional probabilities of the cases given Tc are 2512,2512,251. Hence
In a Black-Scholes setting, two assets share the same volatility but have distinct drifts under the real-world measure. Compare the prices of European calls written on these assets. Now suppose one of the underlying assets is also subject to random downward jumps. How does this affect the comparison?
Solution
High-level idea
In the Black–Scholes model, the price of a European call depends only on the risk‑free rate and volatility, not on the real‑world drift. Hence two assets with the same current price, volatility, strike, maturity, and risk‑free rate have identical European call prices, regardless of their real‑world drifts.
When one asset is also subject to random downward jumps, the comparison changes — but not in the direction naive intuition suggests. Under the risk‑neutral measure the jumps must be compensated by extra drift between jumps so that the forward price is unchanged. The compensated jumps therefore act as a mean‑preserving spread of the terminal price, and the call payoff is convex, so by Jensen's inequality the call on the jump‑exposed asset is more expensive than the call on the pure‑diffusion asset.
Derivation
1. Pure diffusion (no jumps)
Under the risk‑neutral measure Q the asset follows
StdSt=rdt+σdWtQ,
so that
ST=S0exp((r−2σ2)T+σTZ),Z∼N(0,1).
The European call price is
C=e−rTEQ[(ST−K)+]=S0N(d1)−Ke−rTN(d2),
with
d1,2=σTln(S0/K)+(r±2σ2)T.
The formula contains r and σ but no real‑world drift μ. Therefore, if two assets share the same S0, σ, K, T, and r, their European call prices are identical — distinct real‑world drifts are irrelevant.
2. Adding random downward jumps to one asset
Now let one asset follow a jump‑diffusion (Merton 1976). Under a suitable risk‑neutral measure its dynamics are
St−dSt=(r−λκ)dt+σdWtQ+(Yt−1)dNt,
where Nt is a Poisson process with intensity λ, Yt<1 is the downward jump multiplier, and κ=EQ[Yt−1] is the compensator that keeps the expected instantaneous return equal to r. For downward jumps κ<0, so the drift between jumps is raised above r: the compensation exactly offsets the jumps and preserves the forward, EQ[ST]=S0erT for both assets.
Solving the SDE, the terminal price factorizes as
STjump=STdiff⋅J,J=e−λκTi=1∏NTYi,
where STdiff is the pure‑diffusion terminal price and J is an independent jump factor with EQ[J]=1. Conditioning on STdiff and applying Jensen's inequality to the convex payoff x↦(x−K)+,
Taking expectations and discounting shows the jump‑exposed call is worth at least as much for every strike — and strictly more whenever the jumps are genuinely random. Equivalently: at the same forward, the jumps add total risk‑neutral variance, and extra dispersion always benefits a convex payoff (a mean‑preserving spread raises the value of a convex function's expectation).
The tempting argument that "downward jumps create negative skew and therefore depress the call" is wrong because it ignores the compensator: between jumps the asset drifts upward faster than r, and through the convexity of the payoff this more than makes up for the heavier left tail.
As a numerical check, with S0=K=100, r=0.02, σ=0.2, T=1, λ=1, and jump multiplier Y=0.8, Monte Carlo gives a jump‑diffusion call price of about 12.45 versus a Black–Scholes price of about 8.92.
Consequently, the call on the asset with random downward jumps is more expensive than the call on the pure‑diffusion asset.
Final answer
Without jumps the two European calls have the same price. When one asset is also subject to random downward jumps (compensated under the risk‑neutral measure so the forward is unchanged), its call becomes more expensive than the call on the pure‑diffusion asset: the jumps act as a mean‑preserving spread of the terminal price, and the call payoff is convex.
For the Ornstein-Uhlenbeck SDE dXt=θ(μ−Xt)dt+σdWt with initial condition X0, derive the expected value E[Xt] and the variance Var(Xt) as explicit functions of t.
Solution
We start from the Ornstein–Uhlenbeck SDE
dXt=θ(μ−Xt)dt+σdWt,X0=x0.
Step 1. Solve the SDE exactly.
Define Yt=eθtXt. By Itô’s lemma,
Two players share a fair coin and flip it repeatedly, recording the sequence of heads (H) and tails (T) that appears. The first player wins if HTH occurs before HHT; otherwise, the second player wins. What is the probability that the first player wins?
Solution
Idea
Track the game state as the longest suffix of the flip sequence that is a prefix of either target pattern. This yields a small Markov chain whose first-step equations determine the win probability exactly.
States and Transitions
Target patterns: Player 1 wins on HTH; Player 2 wins on HHT.
The transient states are {ε,H,HH,HT}, where ε denotes no useful suffix (start, or after a progress-resetting tail).
State
Flip H
Flip T
ε
H
ε
H
HH
HT
HH
HH
P2 wins
HT
P1 wins
ε
Remark on HHHHH: after any run of heads, the longest suffix that prefixes a target is still HH (the length-2 prefix of HHT).
System of Equations
Let ps denote the probability that Player 1 wins from state s.
Equation (3) reflects that HH is a trap: every additional H keeps the game in HH, and the inevitable first T completes HHT, so Player 1 cannot win from HH.
Solution
Substituting (3) into (2):
pH=21pHT.
Combined with (1), we have pε=pH=21pHT. Substituting into (4):
An oil tanker must transport 3000 gallons of oil from Port A to Port B, which are 1000 miles apart. The tanker loses 1 gallon per mile traveled due to constant spillage, and it can carry at most 1000 gallons at any time. It may deposit oil at any number of intermediate storage ports along the route and later retrieve it. Under an optimal travel plan (choosing where to place storage ports and how to carry the oil), what is the maximum number of gallons that can be delivered to Port B? Round to the nearest gallon.
Solution
This is a classic "jeep problem" (desert crossing) variant. The tanker starts with 3000 gallons at Port A, must travel 1000 miles to Port B, loses 1 gallon per mile, and has capacity 1000 gallons. The goal is to maximize delivered oil.
Key insight: The optimal strategy uses intermediate depots and shuttles oil forward in stages, each stage moving a certain amount of oil a certain distance while consuming fuel for round trips. The number of trips decreases by one each stage.
Let D=1000 miles, capacity C=1000 gallons, initial fuel F=3000 gallons. Consumption is 1 gallon per mile.
General principle: To move n full loads (i.e., n×1000 gallons) a distance d, you make n forward trips and n−1 return trips, consuming (2n−1)d gallons. The amount delivered forward is nC−(2n−1)d.
Stage 1: Start with 3000 gallons at A, i.e., n1=3 loads. Move forward distance d1 such that after shuttling we have exactly n2=2 loads (2000 gallons) at the next depot. Fuel consumed: (2⋅3−1)d1=5d1. Remaining: 3000−5d1=2000⇒d1=200 miles.
Stage 2: At mile 200, we have 2000 gallons (n2=2 loads). Move forward distance d2 to reduce to 1 load (1000 gallons). Fuel consumed: (2⋅2−1)d2=3d2. Remaining: 2000−3d2=1000⇒d2=33331 miles.
Stage 3: At mile 200+33331=53331, we have 1000 gallons (n3=1 load). Drive directly to B, which is 1000−53331=46632 miles away. Fuel consumed: 46632 gallons. Delivered: 1000−46632=53331 gallons.
Thus the maximum deliverable is 53331 gallons, which rounds to 533 gallons.
Verification: Total fuel consumed = 5×200+3×33331+1×46632=1000+1000+46632=246632 gallons, matching 3000−53331. Total distance traveled = same sum, confirming consumption rate.
How many D. E. Shaw interview questions are on QuantGrind?
1,229 questions are tagged to D. E. Shaw across our 2,516-problem set, concentrated in probability, combinatorics, and brainteasers. 74 are free to preview on this page; the full set unlocks with a membership, each with hints, the accepted answer, and a worked solution.
How hard is the D. E. Shaw quant interview?
Expect a phone screen heavy on mental math and probability, then an onsite or final round mixing brainteasers, market-making games, and topic depth. The bar is less about exotic tricks and more about speed, accuracy, and explaining your thinking clearly under time pressure.
How should I prepare for the D. E. Shaw quant interview?
Practice timed, out loud, and without a calculator. Rebuild each answer from first principles rather than recognizing it, and review the ones you got slowly — interview signal comes from how fast and cleanly you reason, not whether you've seen the exact prompt before.
Practice the full D. E. Shaw set
Every question comes with progressive hints, the accepted answer, and a full worked solution. 100 free to start — no card required.