Quant puzzles, solved step by step
- Puzzles
- 100
- Traced to a firm
- 71
- Topics
- 12
- Hard
- 30
001Four people must cross a narrow bridge at night with one torch. At most two can be on the bridge at once, anyone crossing must carry the torch, and a pair walks at the slower person's pace. They take 1, 2, 5 and 10 minutes. What is the shortest total time to get everyone across?Belvedere TradingChicago · 2021
Try it first
Before you plan it: what is the fastest time?
Show the worked solution
17 minutes. Send 1 and 2 over (2 minutes), 1 comes back (1), 5 and 10 cross together (10), 2 comes back (2), and 1 and 2 cross again (2). The obvious plan, where the fastest person escorts each of the others, takes 19. The saving comes from putting the two slowest walkers on the bridge at the same time.
Why does the obvious plan lose two minutes?
Think of two slow parcels going by the same courier. If each travels on its own trip you pay for both trips; if they share a van, you pay for the slower one only. Every crossing costs the slower walker's time, so a slow person paired with a fast one wastes the fast one, and two slow people paired together waste nothing. Escorting with the fastest person pays 10 and then 5 as separate crossings. Pairing 5 with 10 pays 10 once and the 5 minutes are free.
Pairing the 5 and 10 minute walkers on one crossing finishes in 17 minutes, while letting the 1 minute walker escort everyone pays for the 10 and the 5 separately and finishes in 19. What is the price of pairing the slow two?
Somebody has to bring the torch back after the slow pair crosses, and it must not be one of them. So the plan first ferries two fast people over, leaves one on the far side to carry the torch back later, and spends the 2 minute walker's return trip to buy the 5 minute saving. The trade is 1 + 2 extra minutes of shuttling against 5 minutes saved on the slow side, a net gain of 2. With different speeds the trade can flip, which is the real content of the puzzle.
The relationshipa, b the two fastest times, here 1 and 2 c, d the two slowest times, here 5 and 10 What it says in wordsPairing the slow two is better exactly when twice the second fastest time is less than the fastest plus the second slowest.How do you convince the interviewer 17 cannot be beaten?
There must be at least five crossings, three over and two back, because each trip over moves at most two people and someone must return the torch. The 10 minute walker costs 10 on whatever crossing carries them. If 5 and 10 cross separately you already spend 15 on those two trips, and the three remaining crossings cost at least 1 + 1 + 2, which is 19; if they cross together, the best you can do with the other four crossings is 2 + 1 + 2 + 2. A brute force over every schedule gives the same minimum, 17 minutes.
Where candidates lose it
The strong candidate's trap is a fast answer of 19. Letting the quickest person run every errand feels efficient, and it is the right instinct for returning the torch, but it is the wrong instinct for the slow walkers.
The second loss is getting 17 by trial and error and then being unable to say why. State the principle, that the slow pair shares one crossing, and give the rule for when it wins: when twice the second fastest time is below the fastest plus the second slowest.
What the interviewer asks next
- What if the times are 1, 4, 5 and 10?
- Six people with times 1, 2, 5, 10, 20 and 25: what is the plan?
- Write the general algorithm for n people and say its running time.
Asked at Belvedere Trading, Trading, Chicago, 2021 (Wall Street Oasis):
crossing the bridge in the shortest amount of time with one flashlight brainteaser
002You are flying to a city where it rains on 25% of days. You phone three friends who live there. Each tells the truth with probability 2/3, independently of the others, and all three say it is raining. What is the probability that it is actually raining?Jane StreetNew York · 2025
Try it first
Pick your answer before working it.
Show the worked solution
8/11, about 72.7%. If it is raining, all three say yes with probability (2/3)^3 = 8/27. If it is dry, all three must be lying, (1/3)^3 = 1/27. Weight each by how often it happens: 1/4 x 8/27 against 3/4 x 1/27, which is 8 parts to 3. Three agreeing witnesses move a 25% prior a long way, but not to certainty.
Why is the answer not simply 8/9?
Picture a clinic where a test is quite reliable but the illness is uncommon. A positive result makes the illness more likely, but how much more depends on how rare it was to begin with. The friends' agreement tells you how much more likely rain makes their answer than dry does, eight times, but it does not erase the fact that dry days are three times as common. 8/9 is the answer you get if rain and dry start level. Here they do not.
Rain covers a quarter of days and all three friends say yes on 8/27 of those, while dry days cover three quarters and all three lie on only 1/27 of them, so the shaded areas stand 8 to 3 and the chance of rain given three yeses is 8/11, about 72.7%. How do you set it up so the arithmetic stays small?
Use odds rather than probabilities. Posterior odds are prior odds times the likelihood ratioHow many times more likely the evidence is if the hypothesis is true than if it is false., and both are easy numbers here. Prior odds of rain are 1 to 3. The likelihood ratio of three yeses is (2/3)^3 over (1/3)^3, which is 2 cubed, 8. So the posterior odds are 8 to 3, and the probability is 8 over 8 plus 3, 8/11. Each additional agreeing friend would double the odds again.
The relationshipR, D rain and dry YYY all three friends say yes (2/3)^3 and (1/3)^3 the chance of three yeses when it rains, and when it is dry What it says in wordsMultiply the prior odds by how much more likely the evidence is under rain, then turn the odds back into a probability.What assumption is doing the work, and should you say it?
The calculation needs the friends to lie independently. If they could be coordinating a joke, three yeses are really one piece of evidence, and the answer falls back towards the one-friend figure of 2/5. Say the independence assumption out loud, then give 8/11. Interviewers often follow up by making one friend unreliable or by letting them talk to each other.
Where candidates lose it
The most common wrong answer is 8/9: the candidate compares the chance of three truths with the chance of three lies and forgets the weather's own odds. The rain prior is a quarter, and leaving it out quietly assumes it is a coin flip.
The second loss is writing out a full Bayes formula with 27ths and 108ths and losing the thread under time pressure. Odds times likelihood ratio gets 8 to 3 in two lines and is easier to check out loud.
What the interviewer asks next
- What if only two of the three friends say yes?
- How many agreeing friends would you need before you were 95% sure it is raining?
- What changes if the friends can talk to each other before answering?
Asked at Jane Street, Generalist, New York, 2025 (Wall Street Oasis):
There was a question about the probability of rain the next day that relied on a very in depth understanding of bayes theorem
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?Citadel 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.
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 relationshipN the number of draws needed P(N > n) the chance that n draws were not enough U_i the 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.
005Construct two random variables that are uncorrelated but clearly dependent, and show that their covariance is zero.Two SigmaNew York · 2025
Try it first
Which pair works?
Show the worked solution
Take X equal to -1, 0 or 1 with probability 1/3 each, and Y = X squared. Y is fixed by X, so they are as dependent as variables can be. But E[X] = 0 and E[XY] = E[X cubed] = (-1 + 0 + 1)/3 = 0, so the covariance E[XY] - E[X]E[Y] is zero. Correlation only measures straight-line association, and this relationship is a V.
What does correlation actually measure?
Think of a thermostat that runs the air conditioner hard on very hot days and the heater hard on very cold days. Energy use is clearly driven by temperature, but a straight line through the data is flat: high use at both ends, low in the middle. Correlation measures only how well a straight line summarises the relationship, so any symmetric U or V shape can have zero correlation while being completely determined. Independence is the stronger claim that knowing X tells you nothing about Y at all.
With X symmetric about zero and Y equal to X squared, Y is fixed exactly by X, yet the best straight line through the points is flat, so the covariance and the correlation are both zero. How do you show the covariance is zero in one line?
Write the definition and let symmetry do the work. Cov(X, Y) = E[XY] - E[X]E[Y], and with Y = X squared the first term is E[X cubed], which is zero for any X symmetric about zero; the second term has E[X] = 0 in it. With the three-point version you can even list the products: -1 x 1, 0 x 0 and 1 x 1 add to zero. Yet P(Y = 0 given X = 0) is 1 while P(Y = 0) is 1/3, which is dependence in plain sight.
The relationshipE[X^3] zero because the values of X are symmetric about zero P(Y = 0 | X = 0) knowing X changes the odds on Y, so they are dependent What it says in wordsThe covariance cancels by symmetry, while a single conditional probability proves the dependence.Why does a quant interviewer care?
Because models quietly substitute zero correlation for no relationship. A delta-hedged option book gains or loses roughly with the square of the underlying's move, so its daily P and L can show near-zero correlation with the market while being entirely driven by it. The same holds for a volatility strategy or any payoff with a kink. The one case where zero correlation does mean independence is when the pair is jointly normal, which is worth adding before the interviewer asks.
Where candidates lose it
Candidates reach for two independent variables, which are uncorrelated but not dependent, or for X and -X, which are dependent but perfectly correlated. Both show the definitions are fuzzy.
The quieter trap is choosing X uniform on 0 to 1 and Y = X squared. Without symmetry about zero the covariance is positive, 1/12, and the example fails. Centre X first.
What the interviewer asks next
- When does zero correlation imply independence?
- Give an example with zero correlation where Y is not a function of X.
- If you regress Y on X in the example, what do the fitted line and R squared look like?
Asked at Two Sigma, Generalist, New York, 2025 (Wall Street Oasis):
Come up with two uncorrelated but dependent variables.
006A ticket pays Rs 1 if at least one six appears when three fair dice are rolled, and nothing otherwise. What is the fair price of the ticket?Akuna CapitalChicago · 2026
Try it first
Your price, to the nearest paisa band?
Show the worked solution
91/216 of a rupee, about 42 paise. A fair price for a ticket paying Rs 1 is the probability of winning. The fastest route is the complement: the chance of no six on three dice is 5/6 x 5/6 x 5/6 = 125/216, so the chance of at least one six is 1 - 125/216 = 91/216, or 0.421. Adding 1/6 three times gives 50 paise and overcounts.
Why is the price just a probability?
If a raffle pays Rs 100 and you win one time in four, playing many times earns you Rs 25 a ticket on average, so Rs 25 is the break-even price. A ticket paying Rs 1 on some event is worth exactly the probability of that event, because that is its average payout. Trading firms phrase probability questions as prices on purpose: it makes you answer in the units a desk uses, and it sets up the next question, which is where you would quote a bid and an offer.
Of the 216 equally likely rolls of three dice, 125 contain no six, so 91 contain at least one and the ticket's fair price is 91/216 of a rupee, about 42 paise, not the 50 paise that adding 1/6 three times suggests. Why is at least one a signal to use the complement?
At least one six covers exactly one six, exactly two, or three, and each needs its own count. The opposite event, no six at all, is a single clean case: every die avoids six, and independent dice multiply. So the complement takes one line. Adding 1/6 + 1/6 + 1/6 fails because the three events overlap: a roll of 6, 6, 2 is counted once for the first die and again for the second. With ten dice the same mistake would give a probability above 1.
The relationship(5/6)^3 the chance that each of the three dice avoids a six 91/216 the share of the 216 rolls with at least one six What it says in wordsThe chance of at least one success is one minus the chance of none.What does a trader add after the number?
A fair value is the centre of a market, not the market itself. A market maker quotes a bid below 42 paise and an offer above it, and the width depends on how confident they are in the number and how much risk one ticket adds to their book. Here the fair value is exact, so a tight market such as 40 bid, 44 offer is defensible. Saying that sentence turns a probability answer into a trading answer, which is what the question format is inviting.
Where candidates lose it
The fast wrong answer is 50 paise, from adding the chance of a six on each die. It is fast, it feels natural, and it ignores that rolls with two or three sixes get counted more than once.
The second loss is time. In an online assessment where each question has seconds, working exactly one, exactly two and exactly three sixes separately is correct and too slow. The complement is the habit being tested.
What the interviewer asks next
- What is the fair price if the ticket pays Rs 1 for each six that appears?
- How many dice do you need before at least one six is more likely than not?
- Quote me a two-sided market on this ticket and tell me what you do if I lift your offer ten times.
Asked at Akuna Capital, Junior Trader Interview, Chicago, 2026 (Wall Street Oasis):
if you win you get 1$. how much money would be a fair bet
012Speed round: convert 3/32, 7/16 and 11/64 to decimals in your head, and explain the pattern you used.Belvedere TradingChicago · 2021
Try it first
What is 3/32 as a decimal?
Show the worked solution
3/32 = 0.09375, 7/16 = 0.4375 and 11/64 = 0.171875. Every denominator here is a power of two, so the unit fraction is a chain of halvings: 1/2 = 0.5, 1/4 = 0.25, 1/8 = 0.125, 1/16 = 0.0625, 1/32 = 0.03125, 1/64 = 0.015625. Find the rung, then multiply by the numerator. Each decimal ends exactly, because 2 divides a power of 10.
Why do powers of two give clean decimals?
Think of cutting a one-metre ribbon in half again and again: 50 cm, 25 cm, 12.5 cm, 6.25 cm. Each cut adds at most one digit to the length. A fraction terminates in decimal exactly when its denominator has no prime factors other than 2 and 5, so every power-of-two fraction ends, and 1 over 2 to the n has exactly n decimal places. That tells you before you start that 11/64 will have six digits after the point.
Each rung of the halving ladder is half the one above, from 0.5 down to 0.015625 for 1/64, so 3/32 is three of the 0.03125 rung, 0.09375, and 11/64 is eleven of the 0.015625 rung, 0.171875. How do you do 11/64 without losing a digit?
Split the numerator into pieces you already know. 11/64 is 8/64 + 2/64 + 1/64, which is 1/8 + 1/32 + 1/64: 0.125 + 0.03125 + 0.015625 = 0.171875. Or take 11 x 0.015625 as 10 x 0.015625 plus one more, 0.15625 + 0.015625. Either way you add numbers you have memorised instead of dividing. 7/16 works the same way as 1/2 - 1/16, 0.5 - 0.0625 = 0.4375.
The relationship1/8, 1/32, 1/64 rungs of the halving ladder 11 = 8 + 2 + 1 the numerator written in binary What it says in wordsWrite the numerator as a sum of powers of two and add the matching rungs.Why do trading firms test this?
Some bond and futures markets have long quoted prices in 32nds and 64ths of a point, and option deltas and odds come up as fractions all day. A trader who converts 3/32 at the speed of reading reacts to a price while a slower colleague is still dividing. The same round usually mixes in products such as 38 x 42, which is 40 squared minus 2 squared, 1,596: the test is spotting structure that turns long arithmetic into one step.
Where candidates lose it
Candidates try long division under pressure and drop or add a zero: 0.9375 for 3/32 is a common slip, and it is actually 15/16. Knowing the ladder by heart removes the division entirely.
The second loss is rounding. The question asks for the decimal, and 0.094 or 0.17 sounds careless when the exact answer is short and available. Give all the digits, then the rounded figure if asked.
What the interviewer asks next
- What is 13/128 as a decimal?
- Now 38 x 42 in your head, and say the trick you used.
- Convert 0.859375 back to a fraction.
Asked at Belvedere Trading, Trading, Chicago, 2021 (Wall Street Oasis):
3/32 mental math, 38*42, crossing the bridge in the shortest amount of time
013Users join a server at times 1, 2, 4, 5 and 7 and leave at times 7, 3, 8, 9 and 10 respectively. A leave at the same moment as a join is processed first. What is the maximum number of users online at once, and how would you compute it efficiently for a million users?Two SigmaNew York · 2025
Try it first
What is the peak number of users online together?
Show the worked solution
The peak is 3 users. Turn every join into a +1 event and every leave into a -1 event, sort all ten events by time with leaves before joins at equal times, and keep a running total. It goes 1, 2, 1, 2, 3, then at time 7 down to 2 and back to 3, then 2, 1, 0. Sorting costs n log n, and the sweep itself is linear.
Why not check every moment in time?
A shopkeeper who wants to know the busiest moment of the day does not count heads every second; they note each time the door opens in or out and keep a tally. The count of users can change only at a join or a leave, so the maximum must occur just after some join, and you only need to look at the 2n event times. Checking every time step costs time proportional to the length of the day, and comparing every pair of users costs n squared; both are far too slow at a million users.
Each join adds one user and each leave removes one, so a running total over the sorted events finds the peak of 3; processing the join at time 7 before the leave would produce a false peak of 4. Why does the tie rule matter so much?
At time 7 user 1 leaves and user 5 joins. If a user's session is taken to end just before the moment they leave, then a leave and a join at the same instant never overlap, and the leave must be sorted first; sorting the other way invents a user who was never there. In code this is one comparison in the sort key, and it is exactly the detail interviewers use to separate a working answer from a nearly working one. Ask which convention applies before writing any code.
The relationshipd_i +1 for a join and -1 for a leave (t_i, d_i) the sort key: time first, then leaves (-1) before joins (+1) What it says in wordsSort the events so leaves come first at equal times, then the peak is the largest running total.Is there a version that avoids building the event list?
Sort the join times and the leave times separately and walk two pointers through them. At each step take the earlier of the next join and the next leave, taking the leave on a tie, and adjust the count; this is the same sweep without allocating 2n tuples. If times are small integers you can go further: add +1 and -1 into an array indexed by time and take a running sum, which is linear. Mention both and say which you would use for a million users with timestamps in milliseconds.
Where candidates lose it
The trap is the tie. Many candidates write a correct sweep, sort by time alone and get 4, because the join at time 7 is processed before the leave. The question states the convention precisely to see whether you use it.
The second loss is proposing a double loop that checks every pair of sessions. It gives the right answer on five users and fails the question, which asked how you would do it efficiently.
What the interviewer asks next
- Return the time interval during which the peak occurs, not just the count.
- Users arrive as a stream and you must report the current count at any moment. What data structure do you use?
- How many servers are needed if each can hold at most two users at once?
Asked at Two Sigma, Equity Hedge, New York, 2025 (Wall Street Oasis):
Given arrays (start & end) of the times users join and leave a server, find the max number of concurrent users on the server
014Five per cent of fund managers are skilled and beat the market in any given year with probability 60%; the rest are unskilled and beat it with probability 50%. Years are independent. A manager has beaten the market in exactly 8 of the last 10 years. What is the probability the manager is skilled?Citadel SecuritiesMiami · 2022
Try it first
Roughly how likely is it that this manager is skilled?
Show the worked solution
About 12.7%. A skilled manager wins exactly 8 of 10 with probability 0.1209; an unskilled one with 0.0439, a likelihood ratio of about 2.75. Prior odds of skill are 5 to 95, 1 to 19. Posterior odds are 2.75 to 19, so the probability is 0.05 x 0.1209 / (0.05 x 0.1209 + 0.95 x 0.0439) = 0.127. The record helps, but luck has far more players.
Why does an impressive record move the needle so little?
Imagine a thousand people each tossing a coin ten times. About 55 of them will get eight heads or better with a fair coin. If a handful of the thousand had slightly biased coins, you still could not pick them out from the lucky crowd by one run of ten. Evidence moves a belief in proportion to how much more likely it is under one explanation than the other, and 8 wins in 10 is not much more likely from a 60% manager than from a 50% one. The ratio is about 2.75.
Eight wins in ten years has probability 12.1% for a 60% manager and 4.4% for a 50% manager, but after weighting by how common each type is, 5% against 95%, the chance that an eight-win manager is skilled is only 12.7%. How do you set it up quickly?
Use odds. Prior odds of skill are 1 to 19; the likelihood ratioHow many times more likely the evidence is under one hypothesis than under the other. of the record is (0.6/0.5) to the 8 times (0.4/0.5) squared, which is 1.2 to the 8 times 0.64, about 2.75; multiply to get posterior odds of about 0.145. Converting, 2.75 over 2.75 + 19 is 12.7%. The binomial coefficient, 45, is the same in both likelihoods and cancels, so you never need it.
The relationshipS, U skilled and unskilled 0.6^8 0.4^2 the chance of one particular sequence of 8 wins and 2 losses for a skilled manager 0.5^{10} the same for an unskilled manager What it says in wordsPrior odds of 1 to 19, times a likelihood ratio of 2.75, give a posterior of about 12.7%.What does this say about picking managers?
When skill is rare and its edge is small, even a long, strong track record leaves luck as the likelier explanation. Using 8 or more wins instead of exactly 8 barely changes things: the answer becomes 13.9%. The honest limitation is that the model is stylised: real skill is not a fixed 60%, and survivorship means the managers you hear about were already filtered for good records, which pushes the true figure lower still.
Where candidates lose it
The common answer is around 80%, reading the record's win rate as the chance of skill. That skips the prior entirely, and with only 5% of managers skilled, the prior dominates.
The quieter trap is computing the full binomial probabilities, 45 x 0.6 to the 8 x 0.4 squared and so on, and getting lost in decimals. The coefficient cancels. Say odds and likelihood ratio and the arithmetic stays on one line.
What the interviewer asks next
- How many years of 80% wins would you need before the manager is more likely skilled than not?
- What if 20% of managers were skilled?
- How does survivorship bias change the answer if you only ever see managers with good records?
Asked at Citadel Securities, Sales and Trading, Miami, 2022 (Wall Street Oasis):
I got a question about Bayes' theorem applied to a practical scenario, which I handled decently
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?Two 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.
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 relationshipu, v independent uniforms on 0 to 1 (1-u, 1-v) the reflection of a draw through the square's centre P the 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
018I will draw a card from a shuffled deck. You may pay Rs 6 to play a bet that pays Rs 10 if the card is red. Before deciding, you may pay to be told the card's colour. What is the most you should pay for that information?OptiverChicago · 2025
Try it first
What is the information worth?
Show the worked solution
Rs 2. Without information the bet is worth 0.5 x 10 - 6 = -1, so you decline and your value is 0. With the colour known, you play on red and make 4, and skip black and make 0, which averages 2. Information is worth the improvement in your best decision: 2 - 0 = 2. If it would not change what you do, it is worth nothing.
How do you value a piece of information?
Suppose a weather forecast costs money and you are deciding whether to carry an umbrella. If you would carry it anyway, the forecast is worthless to you; it is valuable only if some answer would change what you do. The value of information is the expected value of your best decision with it, minus the expected value of your best decision without it. Work out both decision trees separately and subtract. Never value information by the size of the payout it relates to.
Blind, the bet has an expected value of minus 1 so you decline and get 0; told the colour first, you play only on red and make 4 half the time, an average of 2, so the information is worth Rs 2. Why is it not worth Rs 4 or Rs 5?
Rs 4 is what you make when the card is red, but it is red only half the time. Rs 5 is half the payout, which ignores the Rs 6 you pay to play. The information saves you from the losing half of the bet and lets you keep the winning half, and that is worth half of Rs 4, which is Rs 2. Pay more than Rs 2 and you would do better declining the offer of information and declining the bet.
The relationshippayoff 10 - 6 = 4 on red, -6 on black E[max(payoff, 0)] your value when you can choose after seeing the colour max(E[payoff], 0) your value when you must choose blind What it says in wordsInformation is worth the gap between deciding after you know and deciding before.When is information worth the most?
Vary the price of the bet. At a price of 5 you are exactly indifferent blind, and the information is worth 2.50, its maximum; at a price of 0 you would always play, and it is worth 0. Information is valuable when you are close to indifferent and the decision could go either way. The formula also has the shape of an option payoff: knowing first lets you exercise only when it pays, which is why traders talk about paying for optionality and paying for information in the same breath.
Where candidates lose it
The trap is answering with the size of the win, Rs 4, or half the payout, Rs 5. Both value the information by the bet it is about, not by the decision it improves.
The second loss is forgetting that without information you would decline. Candidates who compare with playing blind, at -1, get 3. The comparison is always with your best action without the information, which here is to walk away.
What the interviewer asks next
- What is the information worth if the bet costs Rs 3?
- What if the information is only 80% reliable?
- You can pay to see one card of a two-card hand before betting. How do you decide what that is worth?
Asked at Optiver, Quantitative Research, Chicago, 2025 (Wall Street Oasis):
Valuing information, taking directional bets when not plus EV.

