Quant interview prep

Combinatorics interview questions

Counting problems separate candidates who reach for a formula from those who reason it out: stars and bars, inclusion–exclusion, symmetry, and clever bijections. These are the patterns that recur across quant trading and research onsites.

315 combinatorics questions · 15 free to preview · 2,516 problems total

15 practice questions

FreeCombinatoricsEasyJane StreetSIGDE Shaw

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 (82)=28\binom{8}{2}=28 chords in total. Choosing 4 chords uniformly at random gives (284)\binom{28}{4} 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 (84)=70\binom{8}{4}=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.

Hence the probability is

P=(84)(284)=7020475=144095=2585.P = \frac{\binom{8}{4}}{\binom{28}{4}} = \frac{70}{20475} = \frac{14}{4095} = \frac{2}{585}.
FreeCombinatoricsEasyJane StreetCitadelSIG

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 BGBBGGGBGGBBBBGBGBBGBBGBBBGBBGGGBGGBBBBGBGBBGBBGBB 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 XX be the number of adjacent boy-girl pairs. For each adjacent pair of positions (i,i+1)(i, i+1) with i=1,,24i = 1,\dots,24, define an indicator IiI_i that the two students at those positions are of opposite sexes. Then X=i=124IiX = \sum_{i=1}^{24} I_i, and by linearity of expectation,

E[X]=i=124E[Ii]=i=124Pr(positions i and i+1 are opposite sexes).\mathbb{E}[X] = \sum_{i=1}^{24} \mathbb{E}[I_i] = \sum_{i=1}^{24} \Pr(\text{positions } i \text{ and } i+1 \text{ are opposite sexes}).

By symmetry, the probability is the same for every adjacent pair; denote it by pp. Hence E[X]=24p\mathbb{E}[X] = 24 \cdot p.

Now compute pp. There are 25×2425 \times 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=15015 \times 10 = 150 ways to choose a boy then a girl, and 10×15=15010 \times 15 = 150 ways to choose a girl then a boy, for a total of 300300 favorable ordered pairs. Thus

p=30025×24=300600=12.p = \frac{300}{25 \times 24} = \frac{300}{600} = \frac{1}{2}.

Alternatively, Pr(boy then girl)=15251024=14\Pr(\text{boy then girl}) = \frac{15}{25} \cdot \frac{10}{24} = \frac{1}{4}, and Pr(girl then boy)=10251524=14\Pr(\text{girl then boy}) = \frac{10}{25} \cdot \frac{15}{24} = \frac{1}{4}, so p=14+14=12p = \frac{1}{4} + \frac{1}{4} = \frac{1}{2}.

Therefore,

E[X]=2412=12.\mathbb{E}[X] = 24 \cdot \frac{1}{2} = 12.
FreeCombinatoricsMediumJane StreetSIGFive Rings

Sandy has 55 pairs of socks in a drawer, each pair a distinct color. On Monday, she randomly picks two socks from the 1010 total; on Tuesday, she picks two from the remaining 88; on Wednesday, she picks two from the remaining 66. What is the probability that Wednesday is the first day she selects a matching pair?

Solution

Let MM, TT, WW be the events that Monday, Tuesday, Wednesday produce a matching pair, respectively. We want

P(McTcW)=P(Mc)P(TcMc)P(WMcTc).P(M^c \cap T^c \cap W) = P(M^c)\,P(T^c \mid M^c)\,P(W \mid M^c \cap T^c).

1. P(Mc)P(M^c). Total ways to choose 22 socks from 1010: (102)=45\binom{10}{2}=45. Matching pairs: 55 (one per color). So P(M)=5/45=1/9P(M)=5/45=1/9, hence

P(Mc)=119=89.P(M^c)=1-\frac19=\frac89.

2. P(TcMc)P(T^c \mid M^c). After a non‑matching Monday, two socks of different colors are removed. The remaining 88 socks consist of 33 colors with 22 socks each and 22 colors with 11 sock each. Total pairs from 88: (82)=28\binom{8}{2}=28. Only the three colors with 22 socks can produce a matching pair, so 33 matching pairs. Thus P(TMc)=3/28P(T\mid M^c)=3/28 and

P(TcMc)=1328=2528.P(T^c \mid M^c)=1-\frac{3}{28}=\frac{25}{28}.

3. P(WMcTc)P(W \mid M^c \cap T^c). After Monday and Tuesday are both non‑matching, the composition of the remaining 66 socks depends on how Tuesday's non‑matching pair was formed. Starting from the Monday state (33 colors with 22 socks, 22 colors with 11 sock), Tuesday's non‑matching pair can be of three types:

  • Case A: Both socks from the 22-sock colors. Number of ways: (32)22=12\binom{3}{2}\cdot2\cdot2 = 12. Resulting state: 11 color with 22 socks, 44 colors with 11 sock. Probability of a match on Wednesday: 1(62)=115\frac{1}{\binom{6}{2}} = \frac{1}{15}.
  • Case B: One sock from a 22-sock color and one from a 11-sock color. Number of ways: 3221=123\cdot2\cdot2\cdot1 = 12. Resulting state: 22 colors with 22 socks, 22 colors with 11 sock, 11 color with 00 socks. Probability of a match on Wednesday: 215\frac{2}{15}.
  • Case C: Both socks from the two 11-sock colors. Number of ways: 11. Resulting state: 33 colors with 22 socks, 22 colors with 00 socks. Probability of a match on Wednesday: 315=15\frac{3}{15} = \frac15.

Total non‑matching pairs on Tuesday: 12+12+1=2512+12+1 = 25, so the conditional probabilities of the cases given TcT^c are 1225,1225,125\frac{12}{25},\frac{12}{25},\frac{1}{25}. Hence

P(WMcTc)=1225115+1225215+125315=12+24+3375=39375=13125.P(W \mid M^c \cap T^c) = \frac{12}{25}\cdot\frac{1}{15} + \frac{12}{25}\cdot\frac{2}{15} + \frac{1}{25}\cdot\frac{3}{15} = \frac{12+24+3}{375} = \frac{39}{375} = \frac{13}{125}.

4. Multiply.

P(McTcW)=89252813125=82513928125=260031500=26315.P(M^c \cap T^c \cap W) = \frac{8}{9} \cdot \frac{25}{28} \cdot \frac{13}{125} = \frac{8\cdot25\cdot13}{9\cdot28\cdot125} = \frac{2600}{31500} = \frac{26}{315}.

Thus the desired probability is 26315\boxed{\frac{26}{315}}.

(One can verify by counting all sequences: total sequences (102)(82)(62)=18900\binom{10}{2}\binom{8}{2}\binom{6}{2}=18900, favorable sequences 52413=15605\cdot24\cdot13=1560, giving the same fraction.)

CombinatoricsWarmupJane StreetSIGDE Shaw

At a formal party, nn men each place their distinct hat in a closet. When the party ends, the power fails and each man randomly selects a hat from the closet. Let p(n)p(n) be the probability that no man receives his own hat. Compute p(5)p(5).

Approach

Consider the event that no man gets his own hat as a permutation with no fixed points — a derangement.

CombinatoricsWarmupJane StreetSIGFive Rings

You have job applications for 4 firms: Morgan Stanley, UBS, Goldman Sachs, and Merrill Lynch. There are 4 envelopes, each addressed to one firm, and 4 personalized cover letters, each intended for a specific firm. A 3-year-old randomly stuffs each letter into an envelope. What is the probability that every letter is mailed to the wrong firm?

Approach

Model the random stuffing as a uniformly random permutation of the 4 letters into the 4 envelopes.

CombinatoricsEasyJane StreetSIGFive Rings

Six points are chosen uniformly at random along the circumference of a circle. The points are then randomly partitioned into three pairs (uniformly over all possible pairings), and a chord is drawn connecting each pair. What is the probability that none of the chords intersect?

Approach

Fix the six points in clockwise order and consider all possible ways to pair them into chords.

CombinatoricsEasyJane StreetSIGDE Shaw

In a single-elimination tournament with 2n2^n strictly ranked teams (higher always beats lower), the bracket is drawn uniformly at random. Find the probability that the top-ranked and second-ranked teams play each other in the final.

Verification. For a tournament with n = 2 (i.e., 4 teams total), what is the probability that the top two teams meet in the final?

Approach

Since the top-ranked team beats everyone, it always reaches the final. What must be true about the bracket placement of the second-ranked team for it to also reach the final?

CombinatoricsEasyJane StreetSIGFive Rings

A class contains 1515 boys and 1010 girls. They line up in a random order. What is the expected number of adjacent boy-girl pairs? For example, the sequence BGBBGGGBGGBBBBGBBGBGBBBGBBGBBGGGBGGBBBBGBBGBGBBBGB has 1414 such adjacent pairs.

Approach

Express the total number of adjacent boy-girl pairs as a sum of indicator variables, one for each adjacent position.

CombinatoricsEasyJane StreetCitadelSIG

Eight bachelors and seven models each independently bought a single ticket for the 15 seats in a row of a theater. The assignment of people to seats is uniformly random. What is the expected number of adjacent seat-pairs that consist of one bachelor and one model?

Approach

Express the total number of adjacent bachelor-model pairs as a sum of indicator variables, one for each adjacent seat pair.

CombinatoricsMediumJane StreetSIGDE Shaw

Zara and Diego are candidates in a school club presidential election. Zara receives aa votes and Diego receives bb votes, with a>ba > b. The votes are tallied one at a time, and the running total is recorded. Compute the probability that Zara is always strictly ahead in the count when a=40a = 40 and b=20b = 20.

Approach

Consider the first vote that is cast — what must it be for Zara to always be strictly ahead?

Related topics & firms

Frequently asked questions

How many combinatorics questions does QuantGrind have?

315 combinatorics questions in total across our 2,516-problem set. 15 are free to preview here; the rest unlock with a membership, each with hints, the accepted answer, and a full worked solution.

Are combinatorics questions important for quant interviews?

Yes — combinatorics shows up in nearly every quant trading and research process, from the first phone screen through the final round. Building fluency here is one of the highest-leverage things you can do to prepare.

What's the best way to practice combinatorics for interviews?

Work problems timed and explain each step out loud, the way you would to an interviewer. When you miss one, redo it from scratch a day later — recognizing a problem is not the same as being able to solve a fresh variant fast.

Practice the full Combinatorics set

Every question comes with progressive hints, the accepted answer, and a full worked solution. 100 free to start — no card required.