Fin Maverick
Foundations VocabularyAccounting & ReportingEconomics & MacroQuant Methods & ProgrammingBusiness & Company AnalysisCorporate Finance & ValuationBehavioural Finance
Banking & Market InfrastructureFixed Income & RatesDerivatives & Structured ProductsPublic EquitiesTransactions & DealsPortfolio ConstructionFunds & AMCs
Private Markets & AlternativesRisk, Treasury & ControlAI & Digital FinanceStochastic Calculus & PricingWealth & Personal FinanceIndian Markets & RegulationProfessional Practice
Explore NISM prep
Series-VIII · Equity DerivativesSeries-XII · Securities Markets FoundationSeries-V-A · Mutual Fund DistributorsSeries-XV · Research AnalystSeries-XIX-E · Category III AIF ManagersSeries-XIX-D · Category I & II AIF ManagersSeries-XIX-C · Alternative Investment Fund ManagersSeries-XVI · Commodity DerivativesSeries-VI · Depository OperationsSeries-II-A · Registrars & Transfer AgentsSeries-I · Currency DerivativesSeries-VII · Securities Operations & Risk Management
Explore Bootcamps
Equity ResearchPortfolio ManagementMutual Fund MasteryInvestment Banking Analyst
Private Equity AnalystQuant & Hedge Fund AnalystBreaking Into VCFinancial Analyst Program
Risk Management ProgramPrivate Wealth ManagementDebt Capital MarketsDerivatives Foundation
Explore Free Courses

Equity Research6

Writing an Investment ThesisBuilding a Discounted Cash FlowReading an Annual Report FastReading a Sector Before a CompanySpotting Quality of Earnings Red FlagsBuilding a Revenue Forecast From Drivers

Portfolio Management3

Rebalancing: When, Why and What It CostsStrategic and Tactical Asset AllocationMeasuring Risk in a Portfolio

Mutual Fund Mastery3

Comparing Funds Without Being FooledHow a NAV Is Struck and Which Day You GetReading a Fund Factsheet Properly

Derivatives Unlocked4

Hedging a Real ExposureThe Greeks, PracticallyFutures, the Basis and What Moves ItReading an Option Payoff

AI For Finance2

Retrieval and Grounding for FinanceDocument Extraction in Finance

Breaking Into Quants4

Backtesting a StrategyHypothesis TestingCleaning Financial DataRegression for Finance

Breaking Into VC3

Sizing a MarketReading a Term Sheet as a FounderHow a Venture Round Actually Works

Financial Analyst Program4

Common Size and Trend AnalysisReading a Cash Flow StatementRatio Analysis That Says SomethingBuilding a Working Capital Schedule

Risk Management Program2

Credit Exposure and How It Is ReducedValue at Risk and What It Hides

Investment Banking Analyst3

Precedent Transactions and Why They DifferReading a Term Sheet StructurallyBuilding a Comparable Companies Table

Private Wealth Management3

Tax Aware Portfolio DecisionsBuilding a Client Risk ProfileGoal Based Planning Arithmetic

Debt Capital Markets3

Analysing an Issuer's CreditDuration and What It Does Not Tell YouBond Pricing and Yield Mechanics

Private Equity Analyst2

Fund Waterfalls and CarryThe LBO in Structure

Hedge Funds Analyst2

Short Selling MechanicsLong Short Mechanics
QuarksCourses
Explore Interview Preparation
Investment BankingEquity ResearchVenture CapitalistPrivate EquityHedge Funds
QuantFinancial AnalysisPrivate Wealth ManagementDebt Capital MarketsRisk Management
Derivatives FoundationPortfolio ManagementMutual Fund Mastery
PartnershipsShowdown
Log inSign up
Interview tracksAll
1Investment Banking
Question bankPuzzlesCase studies
2Equity Research
Question bankPuzzlesCase studies
3Venture Capital
Question bankPuzzlesCase studies
4Private Equity
Question bankPuzzlesCase studies
5Hedge Funds
Question bankPuzzlesCase studies
6Quant
Question bankPuzzlesCase studies
7Financial Analysis
Question bankPuzzlesCase studies
8Private Wealth Management
Question bankPuzzlesCase studies
9Debt Capital Markets
Question bankPuzzlesCase studies
10Risk Management
Question bankPuzzlesCase studies
11Derivatives Foundation
Question bankPuzzlesCase studies
12Portfolio Management
Question bankPuzzlesCase studies
13Mutual Fund Mastery
Question bankPuzzlesCase studies

Quant puzzles, solved step by step

Puzzles
100
Traced to a firm
71
Topics
12
Hard
30
Topic
All topicsLogic and algorithmic reasoning10Conditional probability and Bayes7Counting and combinatorics8Continuous and geometric probability9Correlation, regression and linear algebra9Market making, betting and sizing9Expected value and optimal stopping9Statistics and estimation9Pricing, options and index maths7Games and strategic reasoning8Markov chains and random walks7Mental maths and number sense8
Level
AnyWarm upCoreHard
Source
AnyReported at a firmStandard
Showing 1–10 of 20 · filtered from 100Clear filters
  1. 004You keep drawing independent random numbers, each uniform on 0 to 1, until their running total exceeds 1. What is the expected number of draws?Continuous and geometric probabilityHardCSCitadel SecuritiesChicago · 2025

    Try it first

    What is your instinct for the answer?

    Show the worked solution

    e, about 2.718. The chance that n uniforms still add to at most 1 is 1/n!, the volume of a corner of the n-dimensional cube. The number of draws N exceeds n exactly when that happens, and an expected count is the sum of the chances of exceeding each n. So E[N] is 1 + 1 + 1/2 + 1/6 + 1/24 and so on, which is e.

    Why is two draws the wrong answer?

    Fill a one litre jug with cups of random size, each somewhere between empty and full. On average two cups make a litre, but you stop at the first cup that overflows, and some pairs of cups fall short. Averages of the draws do not tell you the average stopping time: you need the chance that you are still short after each draw. After two draws you are still at or below 1 exactly half the time, so a third draw is needed often, and occasionally a fourth.

    Add the chances you are still going, and the total closes in on e1n = 01.0001n = 12.0001/2n = 22.5001/6n = 32.6671/24n = 42.7081/120n = 52.7171/720n = 62.718drawssumRunning total of the bars so farLimite2.718Bar n = P(total still at or below 1 after n draws) = 1/n!Expected draws = sum of these bars
    The chance of still being at or below 1 after n draws is 1/n!, so the bars run 1, 1, 1/2, 1/6, 1/24, and their running sum, the expected number of draws, closes in on e, about 2.718.

    Where does 1/n! come from?

    For two draws, the pairs with a total at or below 1 fill the triangle under the line x + y = 1 in the unit square, area 1/2. For three, they fill a corner of the unit cube, volume 1/6. In general the region where n uniforms add to at most 1 is a corner of the n-dimensional cube with volume 1/n!, because the n! orderings of the coordinates carve the cube into equal pieces. You can also build it by convolutionThe density of a sum of independent variables, found by combining every way the parts can add up to the same total.: the density of the sum below 1 is s to the power n-1 over (n-1)!, and integrating from 0 to 1 gives 1/n!.

    The relationship
    E[N]=∑n≥0P(N>n)=∑n≥0P(U1+⋯+Un≤1)=∑n≥01n!=eE[N] = \sum_{n\ge 0} P(N > n) = \sum_{n\ge 0} P(U_1+\dots+U_n \le 1) = \sum_{n\ge 0}\frac{1}{n!} = e
    Nthe number of draws needed
    P(N > n)the chance that n draws were not enough
    U_ithe uniform draws
    What it says in wordsThe expected count equals the sum over n of the chance that n draws were still not enough, and those chances are 1/n!.

    How do you check an answer this surprising?

    Check the pieces. N is at least 2 always, since one draw never exceeds 1, so the answer must be above 2; the bars for n = 0 and n = 1 are both 1 for that reason. A simulation of 200,000 runs gives an average of 2.721 draws, within a whisker of 2.718. Saying that you would simulate it, and roughly what you expect to see, is a good close in a research interview.

    Where candidates lose it

    The instinctive answer is 2, because two draws average exactly 1. It confuses the average of the draws with the average stopping time, and it ignores that the stopping rule waits for the total to pass 1, not reach it on average.

    The second loss is knowing the answer is e without being able to say why. The tail-sum formula for an expected count, plus the 1/n! volume, is the whole argument, and it takes three sentences.

    What the interviewer asks next

    • What is the expected number of draws to exceed 2?
    • What is the expected value of the total at the moment it first exceeds 1?
    • What is the probability that exactly two draws are needed?

    Asked at Citadel Securities, Quant Research Interview, Chicago, 2025 (Wall Street Oasis): He was asking some questions about the probability, especially on the convolution.

  2. 016You need to sample a point uniformly at random from a triangle with vertices A, B and C, using two independent uniform numbers u and v on 0 to 1. How do you do it, and why does the formula A + u(B - A) + v(C - A) fail on its own?Continuous and geometric probabilityHardTwo SigmaNew York · 2023

    Try it first

    What goes wrong with A + u(B - A) + v(C - A) for u, v uniform on 0 to 1?

    Show the worked solution

    Draw u and v; if u + v is above 1, replace them with 1 - u and 1 - v; then return A + u(B - A) + v(C - A). The plain formula maps the unit square onto a parallelogram twice the size of the triangle, so half the draws, 50.0% in a simulation, land outside. Reflecting through the square's centre folds that half exactly onto the other, keeping the density flat and wasting no draws.

    Why does the plain formula give a parallelogram?

    Think of a tiled floor where each tile is a parallelogram and you want to pick a spot on one triangular half of a tile. Pick any spot on the tile and half the time you are on the wrong half. A + u(B - A) + v(C - A) with u and v each free on 0 to 1 walks up to one full step along AB and one full step along AC, which covers the parallelogram with corners A, B, C and D = B + C - A, not the triangle. The triangle is exactly the part where u + v is at most 1.

    Half the square lands outside the triangle: reflect it back inu + v > 1u + v below 1(0.8, 0.6)(0.2, 0.4)0011uvreflect: (u, v) to (1 - u, 1 - v)ABCD, never wantednaive point,outside ABCreflected, insideA + u(B - A) + v(C - A)
    Two uniforms fill a unit square that the linear map turns into a parallelogram twice the size of triangle ABC, so draws with u + v above 1 land outside; reflecting such a draw from (0.8, 0.6) to (0.2, 0.4) brings it back inside at a uniformly distributed spot.

    Why does reflecting keep the distribution uniform?

    Two facts. The map (u, v) to (1 - u, 1 - v) is a half turn about the square's centre, so it carries the upper triangle onto the lower one without stretching any area; and an affine mapA linear map followed by a shift, such as A + u(B - A) + v(C - A); it scales every area by the same factor. scales every area by the same factor, so a flat density stays flat. Put together, each small patch of the triangle receives draws from exactly two equal patches of the square. A simulation that splits the triangle into four equal pieces finds 24.9%, 25.1%, 25.0%, 25.0% of the points in them, each a quarter.

    The relationship
    (u,v)↦{(u,v)u+v≤1(1−u, 1−v)u+v>1P=A+u(B−A)+v(C−A)(u,v) \mapsto \begin{cases}(u,v) & u+v \le 1\\ (1-u,\,1-v) & u+v>1\end{cases} \qquad P = A + u(B-A) + v(C-A)
    u, vindependent uniforms on 0 to 1
    (1-u, 1-v)the reflection of a draw through the square's centre
    Pthe sampled point, uniform on triangle ABC
    What it says in wordsFold the unwanted half of the square onto the wanted half, then map it linearly onto the triangle.

    What other methods would an interviewer accept, and which fail?

    Rejection works: throw away draws with u + v above 1. It is correct but wastes half the random numbers. A popular wrong method draws three uniforms and divides each by their sum to get weights on A, B and C; the weights add to 1, but the points pile up near the centre, so the result is not uniform. A correct closed form uses a square root: with r1 and r2 uniform, take (1 - root r1)A + root r1 (1 - r2)B + root r1 r2 C. Name one fast method, prove it, then name the tempting wrong one.

    Where candidates lose it

    The trap is writing the linear formula and stopping, because it looks like a weighted average of the vertices. Half the points leave the triangle, and the candidate who does not draw the square never sees it.

    The second loss is fixing the problem in a way that breaks uniformity, such as normalising random weights to sum to 1 or clamping u + v to 1. Both keep points inside but crowd them into part of the triangle. Say why your fix preserves area.

    What the interviewer asks next

    • Prove the square-root method gives a uniform point.
    • How would you sample uniformly from a convex polygon with n vertices?
    • How would you sample uniformly from the surface of a sphere?

    Asked at Two Sigma, Research, New York, 2023 (Wall Street Oasis): Biased gamblers ruin problems; Markov Chain problems; sampling uniformly from triangle

  3. 019A casino flips a fair coin until the first head appears and pays 2 to the power n rupees if that happens on flip n. Its bank holds only 2 to the power 20 rupees, so it pays at most that. What is the fair price of the game?Expected value and optimal stoppingHardHRHudson River TradingNew York · 2020

    Try it first

    What is the fair price with the bank capped at 2 to the 20 rupees?

    Show the worked solution

    Rs 21. Flip n pays 2 to the n with probability 1/2 to the n, so each of flips 1 to 20 contributes exactly 1 rupee: 20 rupees. Beyond flip 20 the casino pays its whole bank, 2 to the 20, and the chance of getting that far is 1/2 to the 20, which adds 1 more. The famous infinite value collapses to 21 as soon as the payer's bank is finite.

    Why is the uncapped game worth infinity?

    Each extra flip halves the chance and doubles the prize, so each flip adds the same 1 rupee to the average, forever. An expected value is a sum over outcomes of prize times chance, and when every term is 1 and there are infinitely many terms, the sum has no limit. That is the St Petersburg paradox, discussed by Daniel Bernoulli in the eighteenth century: the mathematics says pay anything, and nobody would pay more than a modest sum.

    Each flip adds 1 rupee until the bank runs out; the whole tail adds 1 more15101520212223242526bank cap: 2 to the 20= Rs 10,48,576payout 2 to the n x chance 1/2 to the n = 1 rupee per flipcapped: 1/2, 1/4, ...adds up to 1flip20 flips x 1 rupee+ capped tailFair price = 20 + 1 = Rs 21
    Every flip up to the twentieth contributes exactly 1 rupee to the expected value, and the capped payouts beyond it add up to just 1 more, so a casino with a bank of 2 to the 20 rupees offers a game worth Rs 21.

    What exactly does the cap remove?

    Picture a lottery that promises to double your prize every day for ever, run by a shop with a small safe. The later promises are worth nothing because the shop cannot keep them. The cap turns every term after flip 20 from 1 rupee into 2 to the 20 divided by 2 to the n, which is 1/2, 1/4, 1/8 and so on, and those add up to exactly 1. So the tail that made the value infinite is now worth a single rupee. The bank is Rs 10,48,576 and the game is worth Rs 21.

    The relationship
    E=∑n=1202n⋅2−n+∑n=21∞220⋅2−n=20+1=21E = \sum_{n=1}^{20} 2^n \cdot 2^{-n} + \sum_{n=21}^{\infty} 2^{20} \cdot 2^{-n} = 20 + 1 = 21
    2^nthe payout if the first head arrives on flip n
    2^{-n}the chance the first head arrives on flip n
    2^{20}the bank, which caps every later payout
    What it says in wordsTwenty flips worth a rupee each, plus a capped tail worth one rupee.

    What does this teach about pricing a payoff?

    Doubling the bank adds only one rupee to the fair price: a bank of 2 to the 30, about Rs 107 crore, makes the game worth Rs 31. The value grows with the logarithm of what the counterparty can pay, so the realistic price of a lottery-like payoff depends on who stands behind it. The same idea appears in trading as counterparty risk: a contract's promised payout in extreme states is only worth what the other side can deliver in those states.

    Where candidates lose it

    Candidates recite the St Petersburg paradox and answer infinity, missing the cap in the question. The interviewer has changed one word to see whether you hear it.

    The second loss is getting 20 by stopping at the cap and forgetting the tail. Every sequence of 20 tails still pays the full bank, and that last piece is worth exactly one more rupee.

    What the interviewer asks next

    • How big must the bank be for the game to be worth Rs 50?
    • How much would a player with logarithmic utility pay for the uncapped game?
    • If you could play the capped game a million times, how would the average payout behave?

    Asked at Hudson River Trading, Prop Trading, New York, 2020 (Wall Street Oasis): Questions on EV for coin tosses, law of large numbers, Bayes theorem

  4. 029Rs 1 was invested in a broad stock index 30 years ago. If yearly log returns are independent with mean 7% and standard deviation 16% (illustrative inputs), give a median and a 95% interval for what it is worth today.Statistics and estimationHardOld Mission CapitalChicago · 2025

    Try it first

    Which is the best central 95% range for the Rs 1 today?

    Show the worked solution

    Median about Rs 8.2; 95% interval roughly Rs 1.5 to Rs 45. Log returns add, so after 30 years the log of wealth has mean 30 x 0.07 = 2.1 and standard deviation 0.16 x √30 = 0.88. The median is e to the 2.1, about 8.2. The band is e to the power 2.1 plus or minus 1.96 x 0.88. In rupees it is lopsided, and the mean, about Rs 12, sits above the median.

    Why work in log returns rather than percentage returns?

    Pay rises compound: 10% and then another 10% is 21%, not 20%. Logs turn that multiplication into addition. Log returns add across years, so the 30-year log return is a sum of 30 yearly pieces, and a sum of independent pieces is close to normal. With mean 0.07 and standard deviation 0.16 a year, the sum has mean 2.1 and variance 30 x 0.16 squared, so a standard deviation of 0.16 x √30, about 0.876. The spread grows with the square root of time, not with time.

    The relationship
    ln⁡W30∼N(30μ, 30σ2)W30∈e 2.1 ± 1.96×0.876\ln W_{30} \sim N(30\mu,\ 30\sigma^2) \qquad W_{30} \in e^{\,2.1 \,\pm\, 1.96 \times 0.876}
    W_30value of the Rs 1 after 30 years
    mu = 0.07mean yearly log return, an illustrative input
    sigma = 0.16standard deviation of the yearly log return
    1.96the number of standard deviations that cuts off 2.5% in each tail of a normal
    What it says in wordsBuild the interval for the log of wealth, where it is symmetric, then exponentiate the two ends.
    Symmetric in the exponent, lopsided in rupees0.5125102050100Value of Rs 1 after 30 years, log scalemedian Rs 8.2mean Rs 12.0Rs 1.5Rs 45.5central 95%Each end is the median divided or multiplied by 5.6The same band on an ordinary rupee scale01020304050Rs 6.7 belowmedianRs 37.3 above the medianRs
    On a log scale the 95% band is symmetric around the median of Rs 8.2, running from Rs 1.5 to Rs 45.5; on an ordinary rupee scale the same band reaches Rs 6.7 below the median and Rs 37.3 above it, and the mean of Rs 12.0 sits right of the median.

    Why is the band so lopsided, and where does the mean sit?

    Symmetric in the exponent means lopsided in rupees. Going 1.96 standard deviations down divides the median by e to the 1.72, a factor of 5.6; going the same distance up multiplies by 5.6. Dividing and multiplying by the same factor leaves Rs 6.7 of room below the median and Rs 37.3 above it. The same skew separates mean from median. The mean of a lognormalA variable whose logarithm is normally distributed; it is always positive and skewed to the right. variable is e to the power (mean plus half the variance), about Rs 12.0 here, because a few very good paths pull the average up while most paths finish below it.

    Close with the limits. The 7% and 16% are illustrative inputs, not a claim about any real index. The calculation assumes independent years and constant volatility; real markets have fat tails and calm and stormy regimes, so treat the band as a floor on the true uncertainty. What the interviewer is testing is whether you scale the mean with t and the volatility with √t, and exponentiate only at the end. One useful extra: the chance the Rs 1 is worth less than Rs 1 is the chance the log falls below zero, about 0.8%.

    Where candidates lose it

    The most common slip is building the interval in rupees: take 8.2 and add and subtract a symmetric amount, which can even run below zero. Build it in logs and exponentiate the two ends.

    The second is scaling the 16% by 30 instead of √30, which gives a log standard deviation of 4.8 and a band from paise to crores. Variance adds across years; standard deviation grows with the square root.

    What the interviewer asks next

    • What is the probability the Rs 1 is worth less than Rs 1 today?
    • If you are given the average percentage return rather than the average log return, how do you convert?
    • How does the band change over a 10-year horizon?

    Asked at Old Mission Capital, Prop Trading, Chicago, 2025 (Wall Street Oasis): Confidence interval of portfolio value if you invested $1 in S&P 500 30 years ago

  5. 030We play chess repeatedly. Each game is drawn with probability 1/2; of the decisive games I win 2/3 and you win 1/3. The match ends when one of us wins three games in a row, and a draw breaks any streak. What is the probability I win the match?Markov chains and random walksHardOld Mission CapitalChicago · 2018

    Try it first

    Roughly what is my chance of winning the match?

    Show the worked solution

    86/99, about 86.9%. Track only the current streak: none, me on 1 or 2, you on 1 or 2. Each game I win with probability 1/3, you win with 1/6, and a draw, 1/2, resets the streak. Write my chance of taking the match from each state in terms of the others, solve the five equations, and the start state comes out at 86/99.

    What is the state, and why is the running score not it?

    A door lock that opens after three correct codes in a row does not care how many wrong codes came before the last mistake. The only thing that matters for the rest of this match is the current streak, so the states are: no streak, my streak of 1 or 2, and your streak of 1 or 2. Games won earlier, draws played, games elapsed: all irrelevant once the streak is known. That is the Markov propertyThe future depends on the past only through the present state., and spotting it turns an infinite tree of game sequences into five numbers. Per game, I win with probability 1/2 x 2/3 = 1/3, you win with 1/2 x 1/3 = 1/6, and the rest are draws.

    Five live states, two endings: one equation per live state1/31/61/31/31/61/61/61/31/6 from I on 21/3 from You on 2Startmy chance 86/99I on 129/33I on 210/11You on 128/33You on 28/11I winthe matchYou winthe matchEvery draw (probability 1/2) from any state sends the match back to Start.Grey figure in each box: my chance of winning the match from that state.
    The match has five live states and two endings; solving one equation per state gives my chance of winning as 86/99 from the start, rising to 10/11 when I am on a streak of two and falling to 8/11 when you are.

    How do the equations go, and how do you solve them quickly?

    Let x be my chance from the start, a1 and a2 from my streaks, b1 and b2 from yours. Every equation reads the same way: play one more game, three things can happen. A draw always returns to the start, a win for me always moves to a1 or one step up, and a win for you always moves to b1 or one step up. From a2 my next win ends the match in my favour; from b2 your next win ends it against me.

    The relationship
    x=13a1+16b1+12xa1=13a2+16b1+12xa2=13+16b1+12xb1=13a1+16b2+12xb2=13a1+12x\begin{aligned} x &= \tfrac13 a_1 + \tfrac16 b_1 + \tfrac12 x & a_1 &= \tfrac13 a_2 + \tfrac16 b_1 + \tfrac12 x & a_2 &= \tfrac13 + \tfrac16 b_1 + \tfrac12 x \\ b_1 &= \tfrac13 a_1 + \tfrac16 b_2 + \tfrac12 x & b_2 &= \tfrac13 a_1 + \tfrac12 x \end{aligned}
    xmy chance of winning the match from a fresh start
    a1, a2my chance when I have won the last one or two games
    b1, b2my chance when you have won the last one or two games
    What it says in wordsEach state's value is the average of where the next game can send the match, weighted by the chance of each result.

    Solve by substituting: b2 is in terms of a1 and x, which gives b1 in the same terms; feed that into a2 and a1, and the start equation leaves one unknown. The answers: x = 86/99, a1 = 29/33, a2 = 10/11, b1 = 28/33, b2 = 8/11. Check the ordering: the further I am ahead, the higher the value, and every value sits between 0 and 1. Your chance is 13/99. A quick cross-check: three wins in a row is (1/3) cubed for me and (1/6) cubed for you, a ratio of 8 to 1, which would suggest about 89%; landing within two points of that rough race is a sign no term was dropped.

    Where candidates lose it

    Candidates often forget that a draw resets both streaks, or they let a draw keep a streak alive. The question says draws break any streak, which is why every state has a path back to the start, and dropping that path changes the answer.

    The other loss is trying to add up sequences of games. The sequences never end; the states are five. Name the states first, write one line per state, and the problem becomes algebra.

    What the interviewer asks next

    • What if a draw does not break a streak?
    • What is the expected number of games the match lasts?
    • What if the match needs only two wins in a row?

    Asked at Old Mission Capital, Prop Trading, Chicago, 2018 (Wall Street Oasis): You and I play chess. 1/2 games end in draws and in the other half I win with 2/3 probability

  6. 031Take a random ordering of n distinct numbers and run exactly one left-to-right pass of bubble sort, swapping each adjacent pair that is out of order. What is the probability the list is fully sorted afterwards? Work it for n = 5.Counting and combinatoricsHardJump TradingChicago · 2018

    Try it first

    For n = 5, how likely is the list sorted after one pass?

    Show the worked solution

    2 to the power (n - 1) divided by n factorial, which is 16/120 = 2/15 for n = 5. One pass moves every number that is not carried rightwards exactly one place left. So the list ends sorted only if no number starts more than one place right of its final spot. Placing 1, then 2, then 3 and so on, each has two allowed spots and the largest takes the last one, giving 2 to the power (n - 1) orderings.

    What does one pass actually do to each number?

    Picture a queue at a ticket window where the tallest person seen so far keeps stepping back past anyone shorter. That person travels a long way to the right; everyone they pass shifts one step forward. In one pass, the running maximum is carried right until it meets something larger, and every number it passes moves exactly one place left. Nothing moves left by two in a single pass. That limit is the whole problem.

    One pass moves a number left by one place at most3 1 2 5 4: sorts in one pass3125412345beforeaftersorted: every number is home2 3 1 4 5: does not2314521345beforeafternot sorted: the 1 needed two stepsRule: each number may start at most one place right of its home.Place 1, 2, 3, 4 in turn: 2 allowed spots each. The 5 takes the last spot.2 x 2 x 2 x 2 x 1 = 16 orderings out of 5! = 12016/120 = 2/15
    In 3 1 2 5 4 every number starts at most one place right of its home, so one pass sorts it; in 2 3 1 4 5 the 1 starts two places right of home and ends one short, so only 16 of the 120 orderings of five numbers, 2 in 15, sort in one pass.

    Which orderings survive, and how do you count them?

    Because a number can shift left by one at most, the list sorts only if each number starts no more than one place right of its home. The converse also holds: when every number meets that condition, the pass carries each big number to exactly where it belongs. For five numbers, a brute-force check of all 120 orderings finds exactly the 16 that meet the condition, and all 16 sort.

    Now count them without listing. Place the numbers in increasing order. The 1 may sit in position 1 or 2. The 2 may sit anywhere in positions 1 to 3, one of which the 1 already took: two choices. The same holds for 3 and 4: each has k + 1 allowed spots, k - 1 of them already used by smaller numbers, so two choices each. The 5 fills the one position left. That is 2 x 2 x 2 x 2 x 1 = 16.

    The relationship
    P(sorted after one pass)=2 n−1n!n=5: 16120=215P(\text{sorted after one pass}) = \frac{2^{\,n-1}}{n!} \qquad n = 5:\ \frac{16}{120} = \frac{2}{15}
    2^(n-1)orderings where no number starts more than one place right of its home
    n!all orderings of n distinct numbers, equally likely
    What it says in wordsTwo choices for each number except the largest, over all possible orderings.

    Check small cases out loud: for n = 2 both orderings sort, 2 of 2; for n = 3 it is 4 of 6. The probability collapses fast, because n factorial outruns 2 to the power n: about 4.4% for n = 6 and 1.3% for n = 7.

    Where candidates lose it

    The common wrong start is to think one pass only fixes the largest number, and answer that the other n - 1 must already be sorted, which gives 1/(n - 1)! and 1/24 for n = 5. It misses that every passed number also moves left one place, which rescues many orderings.

    The other loss is guessing a rule from one example. State the one-step-left limit, derive the condition from it, then count by placing numbers in increasing order.

    What the interviewer asks next

    • What is the probability the list is sorted after two passes?
    • How many passes does bubble sort need on average for a random list of n numbers, roughly?
    • What if the pass runs right to left instead?

    Asked at Jump Trading, Research, Chicago, 2018 (Wall Street Oasis): one iteration of bubble sort, what's the probability that the array will be sorted

  7. 032n points are placed independently and uniformly on a circle of circumference 1, with n at least 3. Each point colours the arc between itself and its nearest neighbour. What is the expected total length that gets coloured?Continuous and geometric probabilityHardSusquehanna International GroupLondon · 2026

    Try it first

    Which is closest to the expected coloured length?

    Show the worked solution

    7/18, about 0.389, for every n from 3 upwards. A gap is left uncoloured only when it is longer than both gaps beside it, because then neither endpoint has it as its nearest. For three points that gap is simply the longest of three pieces, which averages 11/18, so 7/18 is coloured. For larger n the same 11/18 comes out, so the answer does not depend on n.

    When is a gap left uncoloured?

    Picture people standing round a circular table, each turning to talk to whoever is closer, left or right. A stretch of table between two people stays silent only if both of them turned away, which means each had a closer person on their other side. A gap is uncoloured exactly when it is longer than both of its neighbouring gaps. A gap coloured from both ends is still coloured once, so the question becomes: what is the expected total length of gaps that are local maxima?

    A gap stays uncoloured only if it is longer than both of its neighbours0.060.040.150.080.100.120.070.080.160.14coloured: 0.57uncoloured: 0.43shorter gap for at least one endpointlonger than both neighboursThree points: the only uncoloured gap is thelongest of three pieces, which averages(1/3)(1 + 1/2 + 1/3) = 11/18Any n: each gap is uncoloured with the sameexpected length, and n of them add to 11/18Expected coloured length7/18 = 0.389Simulated, 40,000 circles: n = 3 gives 0.389,n = 5 gives 0.388, n = 10 gives 0.389
    Each gap is coloured if it is the shorter gap for at least one endpoint and left uncoloured if it is longer than both neighbours; this sample of ten points colours 0.57 of the circle, and the average over all placements is 7/18, about 0.389, for any n of 3 or more.

    How do you get 11/18 for the uncoloured part?

    Start with n = 3, the case you can finish in the room. With three gaps, every gap's two neighbours are the other two gaps, so the only uncoloured gap is the longest one. Three random points cut the circle like a stick broken into three, and the longest of three pieces averages (1/3)(1 + 1/2 + 1/3) = 11/18. So the coloured length is 7/18.

    For larger n, use the fact that the n gaps behave like n independent exponentialA random length whose chance of ending is the same at every instant; waiting times between random arrivals follow it. lengths rescaled to add up to 1, and that the rescaling is independent of the shape. For three unit exponentials X, Y and Z, the expected value of X counted only when X is the largest is 1 - 2/4 + 1/9 = 11/18. Each of the n gaps contributes that, divided by the expected total of n, and the n gaps sum to 11/18 again. The uncoloured share is 11/18 whatever n is, so the coloured share is always 7/18.

    The relationship
    E[coloured]=1−n⋅1n∫0∞xe−x(1−e−x)2 dx=1−1118=718E[\text{coloured}] = 1 - n\cdot\frac{1}{n}\int_0^\infty x e^{-x}(1-e^{-x})^2\,dx = 1 - \frac{11}{18} = \frac{7}{18}
    x e^(-x)a gap's length times its density, in the exponential picture
    (1 - e^(-x))^2the chance both neighbouring gaps are shorter
    1/nrescaling so the n gaps add to a circle of length 1
    What it says in wordsThe expected length of gaps longer than both neighbours is 11/18, and the rest of the circle is coloured.

    Say the check: a seeded simulation of 40,000 random circles gives 0.389 for n = 3, 0.388 for n = 5 and 0.389 for n = 10. The limitation is that the exponential step is a known result you should name, not derive, in an interview; the n = 3 case is the part you prove on the spot.

    Where candidates lose it

    The usual loss is counting gaps instead of measuring them. One gap in three is a local maximum, so candidates answer 2/3 coloured. The uncoloured gaps are selected for being long, which is why their share of length, 11/18, is far above one third.

    The second is double counting a gap that both endpoints colour. It is coloured once. Frame the problem around uncoloured gaps and both mistakes disappear.

    What the interviewer asks next

    • What is the expected number of uncoloured gaps?
    • What if each point colours the arc to its farther neighbour instead?
    • Does the answer change for points on a line segment rather than a circle?

    Asked at Susquehanna International Group, Quantitative Research, London, 2026 (Wall Street Oasis): if n points are placed on a circle and each point colours in the arc to its nearest neighbour

  8. 044A stick of length 1 is broken at three independent uniform points into four pieces. What is the expected length of the longest piece?Continuous and geometric probabilityHardHRHudson River TradingNew York · 2024

    Try it first

    What is the expected length of the longest piece?

    Show the worked solution

    25/48, about 0.521. For a stick broken into n pieces, the expected k-th smallest piece is (1/n)(1/n + 1/(n - 1) + ... ) with k terms. For n = 4 the sorted pieces average 3/48, 7/48, 13/48 and 25/48, which add to 1. The longest is (1/4)(1 + 1/2 + 1/3 + 1/4) = 25/48, more than twice the average piece of 1/4.

    Why is the longest piece so much longer than a quarter?

    Cut a sheet of dough at three random spots and the pieces are rarely even: one is usually a big slab and one a sliver. Random breaks produce uneven pieces, and the longest piece collects the unevenness, so its average sits far above the average piece. The average piece is always 1/4; the question asks about the largest of four correlated lengths, which is an {term('order statistic', 'The k-th smallest value in a sample, for example the minimum, the median or the maximum.')}.

    Four pieces sorted by length: the longest averages 25/48 of the stick3/487/4813/4825/48naive guess: 1/4longest: 25/48 = 0.521Each rank adds one harmonic step, scaled by 1/4shortest1/4 x (1/4)= 3/48 = 0.0625simulated 0.0625second1/4 x (1/4 + 1/3)= 7/48 = 0.1458simulated 0.1457third1/4 x (1/4 + 1/3 + 1/2)= 13/48 = 0.2708simulated 0.2707longest1/4 x (1/4 + 1/3 + 1/2 + 1)= 25/48 = 0.5208simulated 0.5210Simulation: 100,000 sticks, three uniform breaks each.
    Sorted by length, the four pieces of a randomly broken stick average 3/48, 7/48, 13/48 and 25/48 of its length, so the longest piece averages about 0.52, more than twice the naive quarter, and a 100,000-stick simulation agrees to three decimals.

    Where does the harmonic formula come from?

    Start with the shortest piece. The chance that all four pieces exceed x is (1 - 4x) cubed: take x off every piece and the three breaks must fit into the remaining length 1 - 4x. Integrating that from 0 to 1/4 gives an expected shortest piece of 1/16. Then the key fact: the step from each sorted piece to the next adds on average (1/n) times 1 over the number of pieces still longer. After the shortest, three pieces remain longer, so the next piece averages 1/16 + (1/4)(1/3); then add (1/4)(1/2), then (1/4)(1). The longest piece is (1/4)(1/4 + 1/3 + 1/2 + 1) = 25/48.

    The relationship
    E[L(4)]=14(1+12+13+14)=2548≈0.521E[L_{(4)}] = \frac{1}{4}\left(1 + \frac12 + \frac13 + \frac14\right) = \frac{25}{48} \approx 0.521
    L_(4)the longest of the four pieces
    1/4one over the number of pieces
    1 + 1/2 + 1/3 + 1/4the harmonic sum up to the number of pieces
    What it says in wordsThe longest piece averages one quarter of the fourth harmonic number.

    The step rule comes from the fact that the pieces behave like independent exponential lengths scaled to total 1, and the gap between successive minima of exponentials is memoryless. You can name that in the room rather than prove it. The check that the formula is right: the four sorted averages add to exactly 1, and a simulation of 100,000 sticks gives 0.521 for the longest. For n pieces in general, the longest averages (1/n) times the n-th harmonic number, which grows like (ln n)/n.

    Where candidates lose it

    The common loss is answering 1/4, the average piece. The question asks for the average of the largest piece, and the largest of four uneven pieces is usually more than half the stick.

    The second is trying to integrate the maximum directly over the three break points, which gets messy fast. Start from the minimum, use the step rule, and check that the four averages add to 1.

    What the interviewer asks next

    • What is the expected length of the shortest piece for n pieces?
    • What is the probability the four pieces can form a quadrilateral?
    • Break the stick at two points instead. What is the expected longest piece?

    Asked at Hudson River Trading, Campus Algo Dev Interview, New York, 2024 (Wall Street Oasis): I was asked an expected value question involving order statistics.

  9. 045Simplified poker with three cards, A, K and Q: each player antes 1, you are dealt one card and I am dealt another. You may bet 1 or check; if you bet, I call or fold, and if you check the higher card wins the antes. How often should you bluff with the Q, and how often should I call with the K, in equilibrium?Games and strategic reasoningHardOld Mission CapitalNew York · 2022

    Try it first

    How often should I call a bet when I hold the K?

    Show the worked solution

    Bluff with the Q one time in three, and call with the K one time in three. You always bet the A and always check the K; I always call with the A and fold the Q. A Q bluff risks 1 more to win the 2 antes, so I must defend two thirds of hands facing it: the A gives half, the K calling one time in three gives the rest. The game is worth 1/18 per hand to you.

    Which hands are easy, and where is the real decision?

    Clear away the obvious hands first. With the A you always bet, because you win whether I call or fold. With the K, betting only gets called by the A and folds out the Q, which you beat anyway, so you check. As the caller, I always call with the A and always fold the Q. The whole game comes down to two mixed choices: how often you bluff with the Q, and how often I call with the K.

    Equilibrium: bluff the Q one time in three, call with the K one time in threeYour cardeach 1/3AKQBet, alwaysvalue betCheck, alwaysshowdown for 1Bluff 1/3worth -1Check 2/3worth -1Caller facing a betA: call alwaysK: call 1/3, fold 2/3Q: fold alwaysDefends 1/2 + 1/2 x 1/3 = 2/3 vs a bluffWhy 1/3 eachQ bluff: 1/2(-2) + 1/2(c(-2) + (1-c)(+1))equals checking, -1, when c = 1/3K call: (-2 + 2b) / (1 + b)equals folding, -1, when b = 1/3Game value to the bettor: +1/18 per hand
    In equilibrium the bettor always bets the A, always checks the K and bluffs the Q one time in three, while the caller always calls the A, folds the Q and calls with the K one time in three; together the A and the K calls defend two thirds of hands facing a bluff.

    How do the indifference conditions fix both frequencies?

    A teacher who spot-checks homework faces the same logic: check every paper and time is wasted, never check and everyone copies, check at the right rate and copying stops paying. In equilibrium each player mixes at the rate that makes the other indifferent between their two options. Your Q loses 1 by checking. Bluffing loses 2 against my A, and against my K loses 2 if I call and wins 1 if I fold. The two are equal only when I call with the K one time in three. My K loses 1 by folding; calling loses 2 against your A and wins 2 against a bluff, which is worth -1 only when you bluff one time in three.

    The relationship
    12(−2)+12(c(−2)+(1−c)(1))⏟Q bluffs=−1⇒c=13−2+2b1+b⏟K calls=−1⇒b=13\underbrace{\tfrac12(-2) + \tfrac12\big(c(-2) + (1-c)(1)\big)}_{\text{Q bluffs}} = -1 \Rightarrow c = \tfrac13 \qquad \underbrace{\frac{-2 + 2b}{1 + b}}_{\text{K calls}} = -1 \Rightarrow b = \tfrac13
    chow often the caller calls with the K
    bhow often the bettor bluffs with the Q
    -1the payoff of the alternative: checking the Q or folding the K, losing the ante
    What it says in wordsEach frequency is set so the opponent's two choices are worth the same.

    Check against the pot-odds rule. A bluff risks 1 extra to win the 2 antes, so the caller must defend 2/(2 + 1) = 2/3 of the hands facing it; the A already covers half, and the K calling one time in three covers the other sixth. That two thirds is the number people misremember as the K's calling rate. Put the strategies together and the bettor, who acts first with more information about their own hand, earns 1/18 of a chip per hand. The limitation: with a bigger bet or more cards the ratios change, but the method, indifference on both sides, carries over.

    Where candidates lose it

    The common loss is setting the K's calling rate to two thirds. Two thirds is the total defence the caller needs against a bluff, and the A already provides half of it, so the K calls only one time in three.

    The second is never bluffing because the Q cannot win a showdown. A player who never bluffs lets the caller fold every K to a bet, and the A's bets stop earning. The bluff is what gets the A paid.

    What the interviewer asks next

    • What is the value of the game to each player?
    • The bet size doubles to 2. How do the bluffing and calling frequencies change?
    • Now the caller may also bet after a check. What changes?

    Asked at Old Mission Capital, Quantitative Research, New York, 2022 (Wall Street Oasis): Asking to find the game theory optimal strategy in a simplified poker game

  10. 047Two assets' daily returns are negatively correlated within every month, yet their monthly returns are positively correlated across the year. How can that happen? Build a small numerical example.Correlation, regression and linear algebraHardSCSquarepoint CapitalMontreal · 2024

    Try it first

    Both assets share a drift that changes from month to month, plus daily noise that is negatively correlated. What happens to the correlation as you sum more days into one return?

    Show the worked solution

    A drift shared by both assets for the whole month can outweigh daily noise that moves them in opposite directions. Within a month the drift is constant, so only the noise shows and the correlation is negative. Summed over 21 days the drift's covariance grows with 21 squared but the noise's only with 21. With noise correlation -0.5 and drift standard deviation 0.3% a day, monthly correlation is +0.48.

    What does a three-month example look like?

    Picture two shops in the same market street. On any one day, a customer who buys from one did not buy from the other, so their daily takings move against each other. But in festival months the whole street is busy and in the rains the whole street is quiet, so their monthly takings rise and fall together. Correlation at one horizon says nothing on its own about another, because a slow common factor and fast opposing noise can sit in the same data.

    Make it numerical with five-day months. In month 1 both assets drift at -0.8% a day, in month 2 at +0.2%, in month 3 at +1.2%. On top, asset A gets daily noise of +0.6, -0.3, 0, +0.3, -0.6 and asset B gets -0.3, +0.3, 0, -0.3, +0.3, which move in opposite directions. Within each month the correlation is -0.95. Summed over each month, the noise nets to zero, so both assets return -4%, +1% and +6%: identical, a monthly correlation of +1. Even all 15 days pooled show +0.71, because the month-to-month swing in drift is larger than the noise.

    Inside each month the points fall; across months the clusters climb-1%0+1%+2%-1%0+1%asset A daily returnasset B daily returnMonth 1Month 2Month 3Five-day monthsDriftWithin rMonth A, B-0.8%-0.95-4%, -4%+0.2%-0.95+1%, +1%+1.2%-0.95+6%, +6%Noise nets to zero inside each monthCorrelation by frequencyWithin each month: -0.95All 15 days pooled: +0.71Monthly returns: +1.00
    Within each five-day month the daily returns of the two assets slope downward with a correlation of -0.95, but the monthly drifts of -0.8%, +0.2% and +1.2% a day are shared, so the three cluster centres rise together and the monthly returns correlate at +1.

    Why does summing more days push the correlation positive?

    Write each daily return as the month's drift m plus noise. Over n days the drift adds up to n times m, while the noise adds up to a sum of n separate shocks. The drift's contribution to covariance scales with n squared, the noise's only with n, so the longer the horizon the more the shared drift wins. Take noise with standard deviation 1% a day and a within-month correlation of -0.5, and a drift whose standard deviation across months is 0.3% a day. For a 21-day month the drift adds 39.69 to the covariance and the noise subtracts 10.5, for a monthly correlation of 29.19/60.69 = 0.48.

    The relationship
    ρ(n)=n2σm2+n cn2σm2+n σ2ρ(21)=39.69−10.539.69+21=0.48\rho(n) = \frac{n^2\sigma_m^2 + n\,c}{n^2\sigma_m^2 + n\,\sigma^2} \qquad \rho(21) = \frac{39.69 - 10.5}{39.69 + 21} = 0.48
    nnumber of days summed into one return
    \sigma_mstandard deviation of the shared daily drift across months, 0.3%
    cdaily noise covariance within a month, -0.5
    \sigmadaily noise standard deviation, 1%
    What it says in wordsShared drift covariance grows with the square of the horizon, independent noise covariance only in proportion to it.
    Drift covariance grows with days squared, noise covariance only with days+39.69Drift-10.5Noise+29.19Monthly cov21-day month, in % squared21 x 21 x 0.3^2 = 39.69; 21 x (-0.5) = -10.5Variance 60.69, so monthly r = 29.19/60.69 = 0.48-0.4+0.401 day: -0.385 days: -0.0321 days: +0.48flips at 5.6 daysdays summed into one return11121Correlation of summed returnsr(n) = (0.09 n - 0.5) / (0.09 n + 1)
    For a 21-day month the shared drift adds 39.69 to the covariance and the opposing daily noise takes away 10.5, so monthly returns correlate at +0.48, and the correlation of summed returns crosses from negative to positive at about 5.6 days.

    The crossover sits where n times 0.09 equals 0.5, about 5.6 days, so even weekly returns of five days would still show a slightly negative correlation, -0.03. A hedge sized on daily correlation can therefore fail at a monthly horizon, which is why a desk measures correlation at the frequency it actually holds risk. The other mechanisms worth naming are mean reversion in the spread between the two assets and stale prices that lag by a day; both also make correlation depend on frequency. The limitation of the example is the assumption that drift is constant inside a month and noise is independent from day to day.

    Where candidates lose it

    The common loss is saying it is impossible, or that it must be a data error, because correlation feels like a fixed property of two assets. It is a property of two assets at a horizon, and the interviewer wants the decomposition into a slow shared part and a fast opposing part.

    The second is a hand-waved answer with no numbers. Build the five-day example in a minute, state that drift covariance scales with n squared and noise with n, and the explanation becomes checkable.

    What the interviewer asks next

    • What would make daily correlation positive but monthly correlation negative?
    • How would you estimate the shared monthly drift from daily data?
    • A pairs trader hedges at the daily beta and holds for a month. What goes wrong?

    Asked at Squarepoint Capital, Hedge Fund, Montreal, 2024 (Wall Street Oasis): correlation can be negative intra-month but positive across a year, how?

← PreviousPage 1 of 2
  1. 1
  2. 2
Next →
Fin Maverick Free CoursesExplore Free Courses
Fin Maverick BootcampsExplore Bootcamps
Fin Maverick

Finance education that ends in a job, not a certificate that gathers dust. Built for young India.

LEARN
CalculatorsFrameworksComparisonsInterview RoadmapsShowdown
RESOURCES
All CoursesFree CoursesBootcampsInternships
COMPANY
AboutJob openingPartnership
LEGAL
Privacy PolicyTerms & ConditionsContent LicenseReturn & Refund Policy
© 2026 FIN MAVERICK / BUILT FOR INDIA.DO FINANCE, DO NOT JUST READ ABOUT IT.