Derivatives Foundation puzzles, solved step by step
- Puzzles
- 100
- Traced to a firm
- 66
- Topics
- 12
- Hard
- 29
082Without paper: 56 x 56, then 73 x 74.Akuna CapitalChicago · 2025DRWLondon · 2026
Try it first
Which first move gets 56 x 56 out fastest in your head?
Show the worked solution
3,136 and 5,402. Anchor 56 on 50: (50 + 6)^2 = 2,500 + 2 x 50 x 6 + 36 = 3,136. For 73 x 74, square the smaller number and add it once: 73^2 = (70 + 3)^2 = 4,900 + 420 + 9 = 5,329, then 5,329 + 73 = 5,402. Check each a second way: 56^2 = 60 x 52 + 4^2 = 3,120 + 16, and 73 x 74 = 70 x 74 + 3 x 74 = 5,180 + 222.
Why anchor on a round number instead of multiplying digit by digit?
Measuring a room, you do not count tiles one by one; you count whole rows, then the part row, then the corner. A square of side 56 is a 50 by 50 block, two 50 by 6 strips and a 6 by 6 corner. Anchoring on 50 replaces one hard multiplication with four numbers you already hold and one addition, which is the whole trick of mental arithmetic under a clock. 2,500, 300, 300 and 36 add to 3,136. The second strip is the one people drop; say both strips aloud.
A square of side 56 splits into a 50 by 50 block worth 2,500, two 50 by 6 strips worth 300 each and a 6 by 6 corner worth 36, adding to 3,136, and a 73 by 74 rectangle splits into a 73 by 73 square worth 5,329 plus one extra column of 73, adding to 5,402. How do you handle 73 x 74 when neither number is round?
Consecutive numbers are a square plus the smaller number: 73 x 74 = 73 x 73 + 73. That turns the problem into a square you can anchor, (70 + 3)^2 = 4,900 + 420 + 9 = 5,329, and one more addition, 5,402. Rewriting a product into a square and a correction works because a square has a shape you can reconstruct, and the correction is a number you already have. It also stops a common slip: people who try 70 x 74 then add 3 x 74 get it right too, but 3 x 74 = 222 is where under time pressure the 2 and the 22 get muddled.
The relationshipa the round anchor, 50 or 70 b the remainder, 6 or 3 n the smaller of two consecutive numbers, 73 What it says in wordsA square anchors on a round number plus a remainder, and a product of neighbours is the square of the smaller one plus itself.Then check, out loud, in a different way. 56^2 is also 60 x 52 + 4^2, because (n + d)(n - d) = n^2 - d^2 with n = 56 and d = 4: 3,120 + 16 = 3,136. And 73 x 74 = 70 x 74 + 3 x 74 = 5,180 + 222 = 5,402. The interviewer times the first answer but listens for the second route; a trader who checks is worth more than one who is merely fast. The limitation: these tricks suit two-digit numbers near a round anchor; for 87 x 93 use the difference of squares around 90 instead.
Where candidates lose it
The common loss on 56^2 is dropping one of the two cross terms and saying 2,836. Say two times 50 times 6, not fifty times six, so the doubling is audible to you as well as the interviewer.
On 73 x 74 the loss is choosing a route with a hard middle step, like 73 x 70 plus 73 x 4, and stalling on 292. Square and add one copy; it is the shortest path and the easiest to check.
What the interviewer asks next
- Now 87 x 93.
- What is 56^2 minus 44^2, without computing either square?
- Give me 1/56 to two decimal places.
Asked at Akuna Capital, Prop Trading, Chicago, 2025 (Wall Street Oasis):
The mental math problems which were timed, one example was the 56*56
Asked at DRW, Trader Intern Interview, London, 2026 (Wall Street Oasis):Mental math multiplication (e.g. 73*74)
084Orders join a queue at a limit price at random at 2 a minute and are filled at random at 3 a minute. What fraction of the time is the queue empty, and how many orders are in it on average?DRWNew York · 2026
Try it first
What fraction of the time is the queue empty?
Show the worked solution
The queue is empty one third of the time and holds 2 orders on average. With arrivals at 2 a minute and fills at 3, the fill process is busy a fraction 2/3 of the time, so the queue is empty 1/3 of the time. Balancing flow across each arrow of the chain gives share(n + 1) = (2/3) share(n), a geometric ladder starting at 1/3, whose mean is (2/3)/(1/3) = 2.
Why does balancing flow across one arrow solve the whole chain?
Picture a ticket counter with one clerk. Over a long day, the number of times the queue grows from 3 people to 4 must equal the number of times it shrinks from 4 to 3, because you cannot go up through that boundary twice without coming back down through it once. In the long run the flow of arrivals across each boundary equals the flow of fills back across it, which pins the share of time in each state to the share in the state below. Arrivals push at 2 a minute times the share of time at n; fills pull at 3 a minute times the share at n + 1. Equal flows mean share(n + 1) = (2/3) share(n).
Arrivals at 2 a minute push the queue one state to the right and fills at 3 a minute pull it one state to the left, and balancing the two flows across every boundary makes the long-run share of each queue length two thirds of the one before, starting at one third for an empty queue and averaging 2 orders. How do the shares add up to one, and what is the mean?
The shares form a geometric series: share(0), share(0) x 2/3, share(0) x 4/9 and so on. They must sum to 1, and a geometric series with ratio 2/3 sums to 3 times its first term, so share(0) = 1/3. The mean number in the queue is the sum of n times share(n), which for a geometric ladder is the ratio over one minus the ratio: (2/3)/(1/3) = 2. A queue fed at two thirds of its capacity holds two orders on average, and because the mean is rho/(1 - rho) it explodes as arrivals approach fills. At 2.7 arrivals a minute the average would be 9; at 3 it is unbounded.
The relationshiplambda the arrival rate, 2 a minute mu the fill rate, 3 a minute pi_n the long-run share of time with n orders in the queue L the mean number of orders in the queue What it says in wordsEach queue length is two thirds as likely as the one below it, the empty state has share one third, and the average length is two.Two sentences that show you can use it. Little's law says time in the system equals mean number over arrival rate, 2/2 = 1 minute, so an order joining this queue expects to wait a minute to be filled, which is what a market maker deciding whether to post at this price wants to know. The limitation: the chain assumes memoryless arrivals and fills and no cancellations, and real order books have cancellations that depend on queue position, so the geometric shape is a first model, not a description.
Where candidates lose it
Candidates write the balance equations for every state at once and try to solve a system, then run out of time. The cut across a single boundary is the whole method: flow up equals flow down, so each share is a fixed multiple of the one below.
The second loss is answering zero for the empty fraction because orders keep arriving. Fills outpace arrivals, so the queue drains to empty regularly; it is empty exactly the fraction of time the fill process is idle.
What the interviewer asks next
- How long does an order expect to wait from joining to being filled?
- What happens to the average queue if arrivals rise to 2.7 a minute?
- Now orders can also be cancelled at 1 a minute each. How does the chain change?
Asked at DRW, Quantitative Research, New York, 2026 (Wall Street Oasis):
one on birth death chains
085You draw two cards without replacement and win if the first is black and the second red. Would you rather draw from one 52-card deck or from a 104-card double deck?Old Mission CapitalNew York · 2014
Try it first
Before you compute: which deck, and why?
Show the worked solution
The single deck, 25.49% against 25.24%. The first card is black with probability 1/2 in either deck. The second draw is where they differ: with one deck, 26 reds remain in 51 cards, 50.98%; with two decks, 52 remain in 103, 50.49%. Multiply: 26/52 x 26/51 = 25.49% and 52/104 x 52/103 = 25.24%. Removing a black card tilts a small deck towards red more than it tilts a large one.
Why does the size of the deck matter when the mix is the same?
Take one boy out of a class of 20 with 10 boys and 10 girls, and the class is 10 girls in 19, 52.6% girls. Take one boy out of a school of 2,000 split evenly, and it is 1,000 in 1,999, 50.03%. The same removal is a bigger share of a smaller group. Drawing without replacement makes the second draw depend on the first, and the dependence is stronger the smaller the deck, which is exactly what the game rewards. You want a black card to make red more likely next, and a single deck gives you more of that lean.
The chance of black then red is 25.49% with one deck, 25.24% with two and 25.12% with four, falling towards the 25% that independent draws would give, because the second draw after a black card is 26 of 51 in a single deck but only 52 of 103 in a double deck. What is the general pattern, and what is its limit?
With n decks shuffled together, the chance is 1/2 x 26n/(52n - 1). As n grows the second factor falls towards 1/2 and the product towards 1/4, which is the answer you would get if the draws were independent. Every finite deck beats 25%, and the smallest deck beats it by the most, because the minus one in the denominator is a larger share of a smaller count. The whole effect is small, a quarter of a percentage point between one deck and two, which is also worth saying: the interviewer wants the direction and the reason more than the third decimal.
The relationshipn the number of 52-card decks combined 26n/(52n - 1) the chance of red once one black card is gone 1/4 the limit as the deck becomes infinitely large What it says in wordsThe first draw is always a half; the second draw's lean towards red shrinks as the deck grows.Then show you can flip it. If the game paid on black followed by black, the single deck would be worse: 26/52 x 25/51 = 24.51% against 52/104 x 51/103 = 24.76%, and the big deck wins. Same mechanism, opposite sign. Saying that unprompted is what turns a one-line puzzle into evidence that you understand sampling without replacement rather than remembering an answer.
Where candidates lose it
The fast wrong answer is that the decks are the same because both are half red. That is true of the first draw and false of the second; the question is about the pair.
The second loss is computing 25.49% and 25.24% and then picking the double deck because there are more reds in it. More reds and more blacks in the same ratio is not more red; only the removal effect differs, and it favours the small deck.
What the interviewer asks next
- Now you win on black then black. Which deck?
- What is the chance of black then red if you draw with replacement?
- Three cards: black, red, black. Which deck, and does the answer still favour the smaller one?
Asked at Old Mission Capital, Quantitative Research, New York, 2014 (Wall Street Oasis):
If your goal is to draw a black card followed by a red card, which deck would you choose?
086100 passengers board a 100-seat plane in order. The first has lost his boarding pass and sits in a seat chosen at random. Every later passenger takes their own seat if it is free, and otherwise a random free seat. What is the probability that the last passenger gets their own seat?Belvedere TradingChicago · 2022
Try it first
Before any algebra: which seats can the last passenger possibly end up in?
Show the worked solution
One half. By the time the last passenger boards, seats 2 to 99 are always taken, because each owner either sat in theirs or found it taken. The free seat is either seat 1 or seat 100. Every passenger who chooses at random, the first and each one displaced after him, faces seat 1 and seat 100 with exactly the same chance, so the game is equally likely to settle on either. The answer is 1/2 for any plane with two or more seats.
Why do only two seats matter?
Think of a cloakroom where one guest hangs his coat on a random hook. Each later guest uses their own hook if it is free and a random free hook if not. Every hook except two has an owner who will turn up and either use it or find it used. The last passenger can only end up in seat 1 or seat 100, because every seat in between has an owner who boards earlier and leaves it occupied. So the whole question is which of those two seats is still empty when the last passenger walks down the aisle.
In one example passenger 1 picks among 100 free seats and takes seat 23, passenger 23 picks among 78 and takes seat 61, and passenger 61 picks among 40 and takes seat 1, after which everyone sits in their own seat, and at every one of those choices seat 1 and seat 100 carried exactly the same chance, which is why the answer is 1/2. Why are the two endings equally likely?
Follow the chain of displaced people. Passenger 1 picks at random. If he takes seat 1, nobody is ever displaced and the last passenger gets seat 100. If he takes seat 100, the last passenger is shut out. If he takes some other seat k, everyone up to k sits normally and passenger k inherits the problem: a random choice among the free seats, which still include both seat 1 and seat 100. Every random chooser in the chain picks seat 1 and seat 100 with equal probability, and the chain stops the moment either is taken, so the two endings carry the same total weight, 1/2 each. The other seats only pass the problem along; they never decide it.
The relationshipf(n) the chance the last of n passengers gets their own seat 1/n x 1 passenger 1 takes seat 1: the last passenger is safe 1/n x 0 passenger 1 takes the last seat f(n - k + 1) passenger 1 takes seat k, and passenger k faces the same problem with fewer seats What it says in wordsIf the answer is a half for every smaller plane, the recursion gives a half for this one too, and with two seats it is plainly a half.Check it on the smallest case aloud: with two seats, passenger 1 takes his own or the other with equal chance, so 1/2. Running the recursion for every plane from 2 to 100 seats returns exactly 1/2 each time. A useful extension the interviewer often asks next: passenger j, for j from 2 to n, gets their own seat with probability (n - j + 1)/(n - j + 2). Passenger 2 is almost always fine; passenger 99 is fine two times in three. The limitation is in the rules: if displaced passengers preferred seats near the front, the symmetry between seat 1 and seat 100 breaks and so does the half.
Where candidates lose it
The common loss is reaching for 1/100, on the idea that the last passenger is one of a hundred equally unlucky people. That treats the last seat as a random seat. It is not: by the end only two seats can be free, so the answer has to be large.
The second loss is starting the recursion and drowning in cases. Say the two-seat argument first, then use the recursion only as a check. The interviewer is listening for the symmetry between seat 1 and seat 100.
What the interviewer asks next
- What is the chance that passenger 50 gets their own seat?
- What is the expected number of passengers who end up out of their own seat?
- Now the first two passengers have both lost their passes. Does the last passenger's chance change?
Asked at Belvedere Trading, Equity Capital Markets, Chicago, 2022 (Wall Street Oasis):
Drunk passenger on a plane, what's the probability the Nth passenger gets his assigned seat
087What is the expected value of one roll of a fair die? What is the most you would pay to play a game that pays the roll in rupees, and what changes if the game pays the square of the roll instead?Old Mission CapitalChicago · 2020Wolverine TradingChicago · 2024Tower Research CapitalNew York · 2012
Try it first
The game pays the square of the roll. What is it worth?
Show the worked solution
3.5, so pay at most Rs 3.50 for the plain game, and Rs 15.17 for the squared one, not Rs 12.25. The plain game averages 1 to 6: 21/6 = 3.5. The squared game averages 1, 4, 9, 16, 25 and 36: 91/6, about 15.17. Squaring the average roll gives only 12.25 and misses 2.92, which is the variance of the roll. A payoff that bends upward is worth more than its value at the average outcome.
What does fair price mean here?
If a friend offers to pay you whatever a die shows, and you play it a thousand times, you collect close to 3,500 rupees. Paying more than 3.50 a go loses money over the thousand games; paying less makes it. The fair price of a game is the average of what it pays, weighted by how likely each payout is, and the most a market maker would pay is a little under it, to leave room for edge. For one roll each face has weight 1/6, so the expected value is (1 + 2 + 3 + 4 + 5 + 6)/6 = 3.5. Say both numbers: fair value Rs 3.50, and a bid of perhaps Rs 3.25 if you are asked to trade it.
The plain game pays 1 to 6 and averages 3.5, while the squared game pays 1, 4, 9, 16, 25 and 36 and averages 15.17, which sits 2.92 above 3.5 squared, and that gap is the variance of a single roll. Why is the squared game worth more than 3.5 squared?
The trap answer squares the average roll and says 12.25. But the game does not pay the square of the average; it pays the square of whatever is rolled. A 6 pays 36, which is 23.75 above 12.25, and a 1 pays 1, only 11.25 below it. Squaring stretches the high outcomes more than it squeezes the low ones, so the average of the squares, 15.17, sits above the square of the average, 12.25. The gap has a name: E[X^2] - (E[X])^2 is the variance of the roll, 35/12, about 2.92.
The relationshipX the number rolled E[X^2] the fair value of the squared game 35/12 the variance of one roll, the extra value the curve adds What it says in wordsThe squared game is worth the plain value squared plus the variance, so more spread means more value.Then say why a derivatives desk asks it. An option is a payoff that bends upward, like the square, so it is worth more than its payoff at the expected price, and the extra is driven by the spread of outcomes. That is the whole reason volatility has a price. The limitation: fair value assumes you are indifferent to risk and can play many times. Offered one roll of the squared game for Rs 15, a person who cannot afford to lose Rs 14 might sensibly refuse, and an interviewer will sometimes push on that.
Where candidates lose it
On the plain game, candidates sometimes answer 3 or 4 because a die cannot show 3.5. The expected value need not be a possible outcome; it is the long-run average per roll.
On the squared game the loss is 12.25, squaring the average instead of averaging the squares. It is the exact mistake that leads people to value an option at its payoff on the expected price, which is why the interviewer asks it straight after the easy one.
What the interviewer asks next
- What would you pay for a game that pays the cube of the roll?
- You may reroll once after seeing the first roll. What is the game worth now?
- Make me a market on the sum of two dice.
Asked at Old Mission Capital, Trading, Chicago, 2020 (Wall Street Oasis):
What is the expected value of a dice roll?
Asked at Wolverine Trading, Sales and Trading, Chicago, 2024 (Wall Street Oasis):Question about dice, if I rolled a 6 sided dice what is the EV of each roll.
Asked at Tower Research Capital, Intern Interview -, New York, 2012 (Wall Street Oasis):What is the expected value for rolling a dice?
088Rs 1 was invested in a broad equity index 30 years ago. If its log returns average 9% a year with 16% volatility, give a 95% range for what the Rs 1 is worth today, and explain why the range is lopsided.Old Mission CapitalChicago · 2025
Try it first
Which quantity do you build the 95% range on first?
Show the worked solution
Roughly Rs 2.7 to Rs 82.9, around a median of Rs 14.9. Thirty years of log returns sum to a mean of 2.7 with a standard deviation of 0.16 x the square root of 30, about 0.876. The 95% band in logs is 2.7 plus or minus 1.72, from 0.98 to 4.42. Exponentiating gives Rs 2.7 to Rs 82.9. It is lopsided because e to the power stretches gains and compresses losses: 12.2 below the median, 68.0 above.
Why work in logs and not in rupees?
A savings balance grows by multiplying: up 10% then down 10% leaves you at 0.99, not 1. Multiplications are awkward to average, but their logarithms add, and sums of many independent pieces tend towards a bell curve. Log returns add across years, so their total over 30 years has a mean that grows with time and a spread that grows with the square root of time, and the 95% band is symmetric in logs. Here the mean is 30 x 0.09 = 2.7, the standard deviation is 0.16 x 5.477 = 0.876, and 1.96 standard deviations is 1.72. The log of the final value lies between 0.98 and 4.42 with 95% confidence.
Thirty years of log returns averaging 9% with 16% volatility give a final value of Rs 1 that peaks near Rs 6.9, has a median of Rs 14.9 and a mean of Rs 21.8, and lies between Rs 2.7 and Rs 82.9 with 95% confidence, a band that is symmetric in logs but runs 12.2 below the median and 68.0 above it in rupees. Why does the rupee range lean so far to the right?
Converting back means raising e to each end. e to the 0.98 is 2.67 and e to the 4.42 is 82.9, around a median of e to the 2.7, 14.9. The same 1.72 step in logs is a factor of 5.6 either way, and dividing by 5.6 moves you 12.2 rupees while multiplying by 5.6 moves you 68.0. That is why the distribution of wealth has a long right tail: the typical outcome, the median, sits well below the average, Rs 21.8, which is pulled up by the rare decades that compound very well.
The relationshipW_30 the value after 30 years of Rs 1 invested at the start mu the average yearly log return, 9% sigma the yearly volatility of log returns, 16% 1.96 the number of standard deviations that covers 95% of a normal What it says in wordsBuild a symmetric 95% band for the total log return, then raise e to each end to get a lopsided band in rupees.Two cautions the interviewer will reward. First, the 9% and 16% here are assumptions for the exercise; confirm the index's actual history before quoting any real figure, and note that a 30-year average return is itself estimated with a wide error. Second, the band assumes yearly log returns are independent and normal. Real markets have fat tails and runs of bad years, which widen the lower end in particular. The model gets the shape right, a long right tail with the median below the mean, even if the exact ends are only approximate.
Where candidates lose it
The common loss is building the band in rupees with a symmetric plus or minus, which gives a lower bound below zero or a band centred on the wrong number. Wealth cannot go below zero, and any method that says it can has skipped the logs.
The second loss is scaling the volatility by 30 instead of the square root of 30. That gives a standard deviation of 4.8 in logs, a band from almost nothing to tens of thousands, and tells the interviewer you have not met the square-root-of-time rule.
What the interviewer asks next
- What is the probability the Rs 1 is worth less than Rs 1 today?
- Why is the mean of the final value higher than the median?
- If volatility were 25% instead of 16%, what happens to the median and to the mean?
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
089Four doors hide one prize. You pick a door. The host, who knows where the prize is, opens one of the other three that is empty and offers you a switch to either of the two remaining closed doors. Should you switch, and what are your chances each way?Squarepoint CapitalLondon · 2026
Try it first
After the host opens an empty door, what is the chance your original door hides the prize?
Show the worked solution
Switch: either other closed door wins with probability 3/8, against 1/4 for staying. Your door had a 1/4 chance and the host's action cannot change it, because he can always open an empty door among the other three. The remaining 3/4 sat on three doors and now sits on two, so each carries 3/8. Switching does not make you a favourite, it only beats staying, 37.5% against 25%.
Why does your own door keep its 1/4?
A friend who knows the answers to a quiz looks at three questions you did not attempt and crosses out one wrong option. She would have done that whether your own answer was right or wrong, so her crossing out says nothing about your answer. Information only moves probability onto or off your door if the action could have depended on what is behind it, and the host can open an empty door among the other three every time. So your door stays at 1/4, exactly where it started.
Before the host acts each of the four doors carries 1/4, and after he opens empty door 4 your door 1 still carries 1/4 while the 3/4 that sat on doors 2, 3 and 4 now sits on doors 2 and 3, 3/8 each, so switching wins 37.5% of the time against 25% for staying. How does Bayes give 3/8 for each of the other doors?
Say the host opens door 4. If the prize is behind your door 1, he chooses among doors 2, 3 and 4 at random, so he opens door 4 with chance 1/3. If it is behind door 2, he must choose between 3 and 4, chance 1/2; the same for door 3. If it is behind door 4, he never opens it. Multiply each by the prior of 1/4: 1/12, 1/8, 1/8 and 0, which add to 1/3. Divide through and the posterior is 1/4 for door 1, 3/8 for door 2, 3/8 for door 3 and nothing for door 4. The host is more likely to open door 4 when the prize sits behind door 2 or 3 than when it sits behind yours, and that difference is the information.
The relationship1/4 the prior on each door 1/2 the chance the host opens door 4 when the prize is behind door 2 1/3 the chance he opens door 4 when the prize is behind your door What it says in wordsEach closed door you did not pick ends up with three eighths, half again as much as your own quarter.Then generalise, which is what the question tests. With n doors and one opened, staying wins 1/n and each other closed door wins (n - 1)/(n(n - 2)). With three doors that is 2/3, the familiar answer; with 100 doors it is 99/9,800, barely above the 1/100 for staying. The edge from switching shrinks as the host reveals a smaller share of the doors. The limitation is the host's rule: if he opened a door at random and it merely happened to be empty, he would carry no information about the other doors and switching would gain nothing.
Where candidates lose it
The intuitive loss is 1/3 each: three closed doors, so a third apiece. It treats the host's choice as if he had picked blindly, which he did not. The interviewer asks this version precisely to see whether you say why the intuitive answer is wrong rather than recite 2/3.
The second loss is reciting the three-door logic and saying switching wins 3/4. Switching moves you to one of two doors, not to both, so you collect only half of the 3/4.
What the interviewer asks next
- Now the host opens two empty doors and offers you the last closed one. What are the chances?
- If the host opens a door at random and it happens to be empty, should you switch?
- With 100 doors and one opened, by how much does switching beat staying?
Asked at Squarepoint Capital, Quant Research Intern Interview, London, 2026 (Wall Street Oasis):
I was asked why the 'intuitive answer' was not true rather than just what the correct answer was, related to the Monty Hall problem
090An array of n distinct numbers in random order gets one left-to-right bubble pass: swap the first two if they are out of order, then the new second and third, and so on to the end. What is the probability the array is sorted after that single pass? Work n = 4, then general n.Jump TradingChicago · 2018
Try it first
Where must the smallest number start for one pass to leave it at the front?
Show the worked solution
For n = 4 it is 8/24 = 1/3; in general it is 2^(n - 1)/n!. A pass moves any number left by at most one place, so the smallest must start first or second. If it starts first, the rest is the same problem on n - 1 numbers. If it starts second, it swaps to the front and whatever was first becomes the head of a fresh problem on n - 1 numbers. Two choices each time give 2^(n - 1) sortable orders out of n!.
What can one pass actually do to an array?
Picture a queue where the tallest person seen so far keeps stepping past whoever is behind them. The tall ones can travel a long way back; everyone else only gets stepped past, and each time that happens they move forward by one place. A single left-to-right pass carries the running maximum to the right and moves every other number left by at most one position. So a number that starts two or more places to the right of where it belongs cannot get home in one pass, and the array cannot come out sorted.
Running all six orders of 1, 2 and 3 through one bubble pass sorts the four that start 1 2 3, 1 3 2, 2 1 3 and 3 1 2 and leaves 2 3 1 and 3 2 1 unsorted, because in those two the 1 starts two places too far right, and the same count for four numbers is 8 of 24, which is 2^(n - 1) of n! in general. How does that turn into a count of 2^(n - 1)?
Look at where the smallest number starts. It must be position 1 or 2. If it is first, the first comparison does nothing and the pass carries on over positions 2 to n, which is the same problem on n - 1 numbers. If it is second, the first comparison swaps it to the front and the number that was first now leads a pass over positions 2 to n, again the same problem on n - 1 numbers. Each step offers exactly two placements for the current smallest number, so the count of sortable orders doubles with each extra element: f(n) = 2 f(n - 1), f(1) = 1, which gives 2^(n - 1). For n = 4 that is 8 of 24, a third.
The relationship2^(n-1) the number of starting orders one pass sorts n! the number of starting orders in all What it says in wordsThe sortable orders double with each element while all orders multiply by n, so the chance collapses quickly.Then verify on a case you can hold in your head, as the figure does for three numbers: 4 of 6 come out sorted. A brute-force check over every order up to seven numbers gives 1, 2, 4, 8, 16, 32 and 64 sortable orders, as the formula says. The equivalent condition is worth saying too: one pass sorts the array exactly when every number starts no more than one place to the right of its sorted position. The limitation is the assumption that all n! starting orders are equally likely; a nearly sorted array, which is what real data often is, comes out sorted far more often.
Where candidates lose it
The common loss is answering with the chance that the array was already sorted, 1/n!, or with the chance that the largest ends last, which is 1. One pass always puts the maximum at the end; the question is whether everything else is home too.
The second loss is trying to list the n = 4 cases one by one. With 24 orders you will miss some. Find the rule about how far left a number can move and the count follows in two lines.
What the interviewer asks next
- What is the probability the array is sorted after two passes?
- What is the expected number of swaps in one pass?
- If the pass ran right to left instead, which number would be carried, and does the answer change?
Asked at Jump Trading, Quantitative Research, Chicago, 2018 (Wall Street Oasis):
a math problem about the probability an array is sorted after swapping the first two if they're out of order
091I deal a shuffled deck face up one card at a time. At any moment you may say stop; if the next card is red you win, otherwise you lose. What strategy maximises your chance of winning, and what is that chance?Jump TradingChicago · 2018
Try it first
You decide to wait until more reds than blacks remain, then stop. How does that compare with stopping straight away?
Show the worked solution
Every strategy wins with probability exactly 1/2, so there is nothing to optimise. The chance that the next card is red equals the share of red left in the deck, and that share is a fair game: whatever has been dealt, its expected value one card later is its value now. A neat way to see it: the card after you say stop has the same chance of being red as the last card in the deck, and the last card is red with probability 1/2 whatever you do.
Why can't waiting for a good moment help?
Imagine a jar of 26 red and 26 black sweets that a friend pulls out one at a time, and you bet on the colour of the next one. When more reds are left you feel you have edge, but the jar only gets red-heavy after blacks come out, and you do not control which comes out. The share of red remaining has the same expected value one card from now as it has now, so any rule for when to stop is a bet on a fair game and cannot beat 1/2. The fancy name is a martingale: a quantity whose best forecast of its next value is its current value.
Two simulated deals show the share of red among undealt cards wandering around 1/2, with deck A going red-heavy after 7 cards and deck B never going red-heavy and ending on a black card, and the rule of stopping when reds lead gets its chance in 26 deals out of 27 yet wins exactly 1/2, because the deals where it never comes are certain losses. What is the one-line proof the interviewer wants?
Whatever rule you use, you say stop at some point and win if the next card is red. Swap that bet for a bet on the last card of the deck. Given everything dealt so far, the next card and the last card are both a random draw from the same set of undealt cards, so they are red with the same probability. Every stopping rule wins with the same probability as a bet on the bottom card of the deck, and the bottom card is red half the time. That holds for any strategy, so 1/2 is both the best and the worst you can do. A full check of every position from 26 red and 26 black confirms that the best achievable chance from r red and b black is exactly r/(r + b), the chance of stopping right there.
The relationshipR_k red cards still undealt after k cards N_k all cards still undealt after k cards R_k / N_k the chance the next card is red if you stop now What it says in wordsYour winning chance at any moment has the same expected value tomorrow as today, so no rule for when to stop can raise its starting value of a half.Put a number on why the waiting rule fools people. Starting from an even deck, the first black card dealt leaves 26 red in 51, so reds lead immediately half the time, and over the whole deal the moment arrives in 26 deals out of 27. But it typically arrives at a share only just above 1/2, and in the 1 deal in 27 where it never arrives, the last card is black for certain. The edge in the good deals is paid for exactly by the sure loss in the bad ones. The limitation of the result is the payoff: if you were paid more for winning late, or could bet different amounts, the game would no longer be fair and timing could matter.
Where candidates lose it
The common loss is proposing the wait-for-reds-to-lead rule and claiming a small edge, usually around 51%. The interviewer then asks what happens if reds never lead, and the edge disappears. Count both branches before you claim anything.
The second loss is starting a dynamic programme over 27 by 27 states in the room. It works, but it takes far too long. The last-card argument settles it in one sentence and is what the question is testing.
What the interviewer asks next
- Now you win Rs 2 if the next card is red and lose Rs 1 if black, and you must stop at some point. Does timing matter?
- With 3 red and 1 black, what is your chance, and can any strategy change it?
- What changes if you may skip a card without it being revealed?
Asked at Jump Trading, Research, Chicago, 2018 (Wall Street Oasis):
I'm dealing a deck of poker, you can stop me anytime. If the next card is red, you win.
092Screen quotes: the 95 call is 7.00 bid, 7.40 offered, and the 100 call is 4.10 bid, 4.50 offered. You buy the 95 call and sell the 100 call. What do you pay, what is the most you can make and lose, and where do you break even at expiry?Wolverine Trading, Chicago, ILUSA · 2019
Try it first
What does the call spread cost you to put on?
Show the worked solution
You pay 3.30; the most you can make is 1.70, the most you can lose is 3.30, and you break even at 98.30. You buy the 95 call at the offer, 7.40, and sell the 100 call at the bid, 4.10. At expiry the spread is worth nothing below 95, the stock minus 95 between the strikes, and 5 above 100. So the profit runs from minus 3.30 to 5 - 3.30 = 1.70, and is zero when the stock is 95 + 3.30 = 98.30.
Which side of each quote do you deal on?
At a currency counter at the airport there are two rates on the board: the one they buy at and the one they sell at, and you always get the worse one for you. Option screens are the same. If you want to trade now, you buy at the offer and sell at the bid, so a two-leg trade pays the spread on both legs. Buy the 95 call at 7.40, sell the 100 call at 4.10, net debit 3.30. At the mid prices, 7.20 and 4.30, the same trade would cost 2.90. The 0.40 difference is the cost of crossing two bid-offer spreads of 0.40 each, half of each.
Bought across the bid-offer for 3.30, the 95/100 call spread loses 3.30 below 95, gains one for one between the strikes, makes 1.70 above 100 and breaks even at 98.30, while the same spread at mid prices would cost 2.90 and break even at 97.90. How do you read off the maximum profit, loss and break-even?
Walk the stock price up. Below 95 both calls expire worthless, so you lose the 3.30 you paid. Between 95 and 100 only the long call pays, one for one, so the profit rises from minus 3.30. Above 100 the short call pays out as fast as the long call pays in, so the value is capped at the strike gap of 5. A call spread can never be worth more than the gap between its strikes, so the most you can make is 5 minus what you paid, 1.70, and you break even where the stock has risen 3.30 above the lower strike, at 98.30.
The relationship7.40 the offer on the 95 call, what you pay to buy it 4.10 the bid on the 100 call, what you receive to sell it S* the break-even stock price at expiry What it says in wordsPay the offer, receive the bid, and the spread's payoff is boxed between losing the premium and making the strike gap less the premium.Two checks to say aloud. First, the price passes the no-arbitrage bounds: a 95/100 call spread must cost between 0 and 5, and 3.30 does. Second, the risk-reward: you risk 3.30 to make 1.70, which only makes sense if you think the stock finishes above 98.30 more than 3.30/5 = 66% of the time. The limitation: this is the payoff at expiry. Before expiry the spread's value moves with volatility and time, and you could unwind it, but again only by selling the 95 at its bid and buying the 100 at its offer.
Where candidates lose it
The common loss is using mid prices and answering 2.90, as if the screen would trade with you at the middle. The interviewer gave you two-sided quotes precisely to see whether you know which side you hit.
The second loss is getting the maximum profit wrong by forgetting the cap, and saying it is unlimited because you own a call. You also sold one, and above 100 the two cancel; the most a 5-wide spread can ever be worth is 5.
What the interviewer asks next
- What would you pay if you could work both orders at mid?
- At what price would you buy the 95 call and sell the 100 call so that you risk exactly as much as you can make?
- Build the same view with puts. What are the costs on this screen if the 95 put is 1.80 at 2.10 and the 100 put is 3.70 at 4.00?
Asked at Wolverine Trading, Prop Trading, Chicago, IL, USA, 2019 (Wall Street Oasis):
pricing options given an ask and a bid price for options with different strikes if you were to short one and long another
