• C++ Programming for Financial Engineering
    Highly recommended by thousands of MFE students. Covers essential C++ topics with applications to financial engineering. Learn more Join!
    Python for Finance with Intro to Data Science
    Gain practical understanding of Python to read, understand, and write professional Python code for your first day on the job. Learn more Join!
    An Intuition-Based Options Primer for FE
    Ideal for entry level positions interviews and graduate studies, specializing in options trading arbitrage and options valuation models. Learn more Join!

7.7 Jane Street interview questions

For the weight of ocean problem - I'd have go like this:
Meridian is 10,000km from North Pole to Equator (from original definition of the meter 1/10,000,000 of the meridian).
Surface area covered by water ~2/3
10,000km that's 90 degrees or 3/2 times a Radian so radian about 2/3 the meridian and thus the radius is thus about 6,600km.
Area of sphere 4*pi*r^2
=4*3*2/3*2/3*10000*10000 #pi=3, radian = 2/3*10000
=16/3*1E8 # canceling above and below = surface area of sea sqkm
Assume average depth to be say 4km - this is biggest uncertainty anything between 3-5 is reasonable, I'd say.
=4*1000* 16/3*1E8 = 64/3 *1E11
=21*100,000,000,000 cubic km
=2.1 T cubic km

=Weight of cubic km of seawater - a little heavier than pure water, say, 3% thus 1cukm =1GT+3%=1.03E9
=2.163 E12* E9
=2.1E21 kg

Wikipedia and all give it at more like 1.4E21 - I think my depth guess ruined it - and rounding Pi
[rounding Pi is a joke]
 
Last edited:
Pre-Interview
(Ten minutes)

1) Mental Math: One million minus one hundred eleven.
2) Mental Math: Fifty-four percent of one hundred ten.
These have been solved above -- not much to add.

3) Game: With one die, suppose in a round, you earn the amount of dollars equal to the value of the upwards face of the die. (eg. you earn $6 if you roll a six.) Now also suppose after your first roll, you are given the opportunity to cancel your first and roll again, taking that value as the final value. What should your strategy be?
If you're only rolling once, then the expected value of the game is 3.5. So, if your first roll is a 1, 2, or 3, you should opt to roll again, and if you receive a 4, 5, or 6, then you should keep that value.

4) What's the closest integer to the square root of 1420.
Again, solved above.

5) You and a roommate are hosting a party. You invite 10 other pairs of roommates. During the party you poll everyone at the party (excluding yourself) and ask how many hands each person shook. Two conditions:
a) Each person did not shake his roommate's hand.
b) Each person shook a different number of hands.
Question: How many hands did you roommate shake?
There are 21 people to assign handshake numbers to; the maximum number of possible handshakes a single person could have made is 20, since a person can't shake hands with himself or his roommate. So, the 21 people have values from 0-20, inclusive. After trying this problem out with smaller cases, it should be clear that the sum of a pair of roommates' handshakes must equal 20. But this means that there must exist a pair of roommates with 10 handshakes each; you must be one of these roommates, since everybody shook a different number of peoples' hands. Therefore, your roommate shook 10 hands.

6) a) You roll a die, and are given an amount in dollar equal to the number on the die. What would you pay to play this game if you played it a lot of times? This is a very unclear question; the expected value per roll is (1 + 6) / 2 = 3.5. So 3.5 * # of rolls allowed?
b) now say that when you roll the die, you're allowed to either take the money that you'd get with the roll, or roll a second time; if you roll a second time, you're obligated to take the number of dollars that you get with the second roll. Now what is the worth of the game? It's easy to show that the optimal strategy must take the form "if current value <= T, then roll again; else, stay" -- to prove this, consider all possible other strategies and show that they must be inferior. Now, we just need to find T. On the first roll, the probability of getting <= T is T/6 and > T is 1-(T/6). In the latter case, the expected value is (6+T+1)/2. In the former case, the expected value is (1+6)/2 = 3.5, since we're forced to keep the second roll's value. The total expected value is T/6 * 3.5 + [1-(T/6)] * (T+7)/2. Maximizing with respect to T, we get T = 3. Substituting, the game value is $4.25.
c) Same thing as above, except you have an option to play the game a third time. Too lazy to write it out; but this is the same thing as part b). I'm pretty sure that there's a nice way to do this if you have the option to play the game a total of n times via recursion.

Interview
(Thirty minutes)

1) Suppose you are given the opportunity to bid for a treasure chest, which you know with 100% confidence to be priced anywhere between $0-$1000. If you bid equal to or above the price, you win the treasure chest (at the cost of your bid). If you bid below the price, you do not earn the treasure chest. Now, also suppose you have a friend who is willing to buy the treasure chest from you for one and a half times the price of the treasure chest (should you obtain the chest). What should your bid be? I'm assuming that the probability distribution of the treasure chest is uniform; this makes sense if we assume no prior knowledge on the treasure chest. Suppose our bid is B and the price of the chest is C; note that B is a fixed value while C is a random variable. We have that P(C < B) = B/1000 and P(C >= B) = 1 - B/1000. In the latter case, our net gain is 0. In the former case, our net gain is 1.5C - B. Our expected net gain is thus E[B/1000 * (1.5C - B)] = B/1000 * (1.5*500-B) = B*(750-B)/1000. This is maximized when B = 375, so this is the right bid.

More generally, if we don't know that the price of the treasure chest is uniform, then the only thing we need to know is the expected value of the treasure chest to compute the optimum bid.


2) In Baseball, the batting average is the number of hits over the number of at bats. Player A has a greater batting average than Player B in the first half of the season and the second half of the season. Is it possible that Player B would have a higher batting average for the entire season? Yes; season 1 -- A scores 1 hit on 1 ball, B scores 999 hits on 1000 balls. Season 2 -- A scores 10 hits on 20 balls, B scores 9 hits on 20 balls.

3) How much calories does a Big Mac have? Would you bet $1 on it? How about $10? I guessed 900 calores; I wouldn't bet anything on this, since I don't eat McDonalds :P

4) How many tons does the ocean weigh? I know the distance from Florida to California to be about 3000 miles -- this spans 3 timezones, so the circumference of the earth is ~24000 miles => R = 24000 / (2 * pi) ~ 4000 miles (I'm assuming that pi = 3 everywhere). This is about 6400 km (surprisingly, the true radius is 6378 km, which isn't too far off). Now, assume the depth of the oceans to be 4 miles, or 7 km at max, on average. The total volume is then 0.75 * 4*pi*R^2 * depth, assuming that the oceans cover 75% of the earth -- this is 3/4*4*3*(6400*6400)*7 ~ 9 * 8^4 * 7 * 10000 ~ 60 * 4000 * 10000 ~ 2 400 000 000 km^3 = 2.4 e 9 km^3 = 2.4 e 18 m^3. Ocean water has density 1 000 kg/m^3, so it's 2.4 e 21 kg in total. The actual weight is somewhere around 4 e 21 kg.

5) How much would you be willing to bet on it being within 25% of that at even odds? I never came up with confidence intervals for the previous answer, but the trick to doing this is to come up with a confidence interval -- too lazy to do this now :)

6) A company has a value V which is uniformly distributed between 0 and 1. you are planning to place a bid B for the company. If B is smaller than V, then your bid loses and you get nothing; if B is larger than V, you get to purchase the company at price B, and the company will end up being worth 1.5 * V. What price B should you bid to maximize your profit? This problem is identical to problem 1. It's 0.375.

7) On a sheet of paper, you have 100 statements written down. the first says, "at most 0 of these 100 statements are true." the second says, "at most 1 of these 100 statements are true." ... the nth says, "at most (n-1) of these 100 statements are true. ... the 100th says, "at most 99 of these statements are true." how many of the statements are true? More generally, suppose that we have n statements, and let statement k read "at most k of these n statements are true" for k = 0, 1, 2, ..., n - 1. Note that if statement k is true, then so are statements k + 1, k + 2, ..., n - 1. But, if statement k is true, then there must be at most k true statements while n - k statements are true. We have that n - k <= k, so k >= n / 2. In our case, n = 100, so k >= 50 (round up). If k = 50 (statements 50 - 99 are true), then everything checks out. If k = 51 (statements 49 - 99 are true), this doesn't work out, so exactly 50 statements are true.

8) You have two decks of cards: one has 13 reds and 13 blacks, and the other has 26 reds and 26 blacks. We play a game in which you select one of the two decks, and pick two cards from it; you win the game if you select two black cards. Which deck should you select to maximize your chances of winning? Try to do this problem in your head, without writing any calculations down. It's 26 and 26. After picking the first black card, the chances of choosing another one goes down; you want to make this decrease as small as possible, so choosing the 26 and 26 deck works better. If this is hard to see, imagine if you had 1000 reds and 1000 blacks. P(black the first time) = 1/2 and P(black the second time) = very close to 1/2. With a 2/2 deck, P(black the first time) = 1/2 and P(black the second time) = 1/3. More cards = better here.

9) You have a deck of 52 cards, and you keep taking pairs of cards out of the deck. if a pair of cards are both red, then you win that pair; if a pair of cards are both black, then I win that pair; if a pair of cards has one red and one black, then it's discarded. If, after going through the whole deck, you have more pairs than I do, then you win $1, and if I have more pairs than you do, I win $1. What is the value of this game in the long run? Seems to be 0 to me by symmetry.
 
Treasure chest - a different perspective (no need for integral)

B = bid, V value of chest.

Chance to 'Win' = B/1000 (It doesn't matter that there are seemingly two variables... like chance of two dice coming up the same is same as one dice matching a given single number 1/6) {Addendum except when value is 0 but this doesn't materially affect the result}

When you lose, you lose nothing 1-B/1000 of the time.

The other B/1000 of the time...
Then I have 'won', V can lie anywhere between 0-B

I will make a profit only 1/3rd of time when V>2/3*B
The maximum profit is 50% of B (max at V=B falling to 0 profit in range 2/3*B<=V<=B)
The maximum loss can be 100% of B (the chest is $0) (also falling to zero loss when V tends to 2/3*B)

So immediately by observation it 'looks' like a crappy deal - but how crappy?

Cos you can only make money 1/3 of time and that is half of what you can maximally lose, and you will lose 2/3 of time

So doing it geometrically you could draw the profit for the interval 0-B
E.g. have two triangles the gradients are constant - cos gradient is given in terms of B.

Area of triangle under axis (has +ve gradient)(loss) 0 to 2/3*B (y=3/2*Bx -B):
= 1/2* -B * 2/3*B
= -1/3*B^2

Area of triangle above axis (it has +ve gradient) (profit) 2/3*B to B (y=3/2*x -B)
= 1/2*(1/3*B) *B/2
= 1/12*B^2

Summing over 0 to B (the units are B^2 cos this is the scale on both axis (but since it is prob density 1/B and probability of 'win' = B/1000
= -1/3+1/12 = -1/4*B^2

Sum is -B^2/4000



Expected gain is -B^2/4000

So bid $0.... and lose nothing - rather than lose up to 1/4 on average (for big bids) of your bid everytime you win. You can lose 100% of a winning bid.
 
Last edited:
Interview
(Thirty minutes)

1) Suppose you are given the opportunity to bid for a treasure chest, ....

To make this problem a little bit more interesting, let's add to the friend's offer: let's say the friend is willing to buy the treasure chest for $60 plus one and a half times the price of the treasure chest. Now, what should your bid be?

Se my answer but the intercept of the straight lines would slide up the y axis by 60/1000. The you work out the area of the triangles again.
 
Interview
(Thirty minutes)

1) Suppose you are given the opportunity to bid for a treasure chest,.....
. This is maximized when B = 375, so this is the right bid
...

I don't think so - cos even when you have 'won' the bid the new game is to be above the value by less than 1/3B...
Which you won't be 2/3 of the time and you can lose up to 375 but only win up to 187.25.
 
Pre-Interview
...
6) a) You roll a die, and are given an amount in dollar equal to the number on the die. What would you pay to play this game if you played it a lot of times?
b) now say that when you roll the die, you're allowed to either take the money that you'd get with the roll, or roll a second time; if you roll a second time, you're obligated to take the number of dollars that you get with the second roll. Now what is the worth of the game?
c) Same thing as above, except you have an option to play the game a third time.
...
a) Nothing. It does not mention me having to pay anything to play!
a) 2nd version, As little as possible! A 'fair' price would be $3.5 - so up to that. But that is not the question!
 
@xcx You do not lose the value of your bid when you don't win the chest, so you can never lose 100% of your bid.

I don't mean 100% loss when you don't win - I don't think I said that - OK qualification added on last line fixed.

But you can lose 100% when you do win - if the chest value is $0 and you have bid $100 the friend pays you $0.
But granted that is only 1/1000 of hapening, but still... if it is only $10 you still lose $85
Actually it would have 1/100 chance of happening if your $100 bid 'won'.



OK I shall clarify the original ....
 
Last edited:
I'm not thinking very clearly so I might be making a critical mistake, but it seems like if we assume a uniform distribution it's immediately obvious that we don't want to play the game at all (as @xcx concludes).

You can only win chests that are worth less than your bid, and you receive 1.5 times the value of the chest from your friend. So no matter what your bid is, the chest values can be [0, B], and therefore the expected value of any given chest you win is E(V) = B/2. Your friend pays you 1.5 * V, so E(1.5 * V) = 1.5 * E(V) = 1.5 * B / 2 = 0.75 * B.

This leads to the same result as @xcx, that you just lose 1/4 of your money in expectation, but my method just makes more sense to me.

Edit: This is where @Karth 's argument seems to fall apart: E[B/1000 * (1.5C - B)] = B/1000 * (1.5*500-B). E[B/1000 * (1.5C - B)] is different from E[B/1000 * (1.5*E[C] - B)], and E[C] is conditional on B (the average chest is not worth $500 if you're getting paid for it, unless you always bid $1000).
 
Last edited:
So no matter what your bid is, the chest values can be [0, B], and therefore the expected value of any given chest you win is E(V) = B/2. Your friend pays you 1.5 * V, so E(1.5 * V) = 1.5 * E(V) = 1.5 * B / 2 = 0.75 * B.

I don't believe that this line of thought is correct; note that we have control over B (so it is a fixed constant which we try to determine) while V is a random variable that is *totally independent of V.* This last part is very important; because B and V are independent, it is impossible for E[V] = B/2, as it implies that B and V are dependent -- to see why this is the case, this line of thought suggests that if we bid B = 0, then the value of the treasure chest MUST be V = 0, which doesn't make sense.

I don't think so - cos even when you have 'won' the bid the new game is to be above the value by less than 1/3B...
Which you won't be 2/3 of the time and you can lose up to 375 but only win up to 187.25.

I don't follow your argument; could you clarify?
 
I don't follow your argument; could you clarify?
profit.png

So, if you have ‘won’ (chance of winning is B/1000) the value of V must be somewhere 0 to B (otherwise you wouldn't have won and we wouldn't have got here and most importanly it won't have cost anything - a bit anthropic principle-ish).

For the case where you have 'won', the corresponding profit as V varies linearly across range 0-B is given in graph above.

Integrate to get your expected return. The total area under graph is -B^2/4 (as earlier calculation).
B^2 because both axis are give in terms of B - but since it's probability density it is 1/B factor to multiply the result - like integration.

So the payout if you win is (usually) crap - it is a loss 2/3 of time.

Now combined with winning chance which is B/1000 is left as an exercise for the student.

But you have to let go of idea that V is a separate variable.

Put another way... if V is on the range 0-1000 you have to guess between V and 3V/2 to make a profit. For small values of V, say, 100 that means you have to guess between 100-150 to make any money... a range of 50 out of 1000 5% chance! but a 85% of losing money and 10% of making nothing- anything you guess above 150 is a serious loss making proposition - $0 to $850 loss.

If V is now, say, 900 (it will be above 900 10% of time only) and thinking about it this way you will only hit that profitable sliver 10% of your guesses) then you can make a up to $450 profit 1% of time [10% of 10%] and nothing rest of time.

But like I said in earlier V as a variable is a bit of a red herring. It is easier to think in terms of you have won which is B/1000. Now once you calculate the expected value of a 'win' -B/4 and the chance of winning is B/1000 (not winning has no expected value). the extra 1/000 comes with density function.

So it's -B^2/4000


Anyway, a fair price for your friend to pay would be a 100% markup on the value. That way the above line crosses the axis midway between 0 and B, and the profit and loss triangles are equal. Long term expectation =$0.
 
Last edited:
You can only win chests that are worth less than your bid, and you receive 1.5 times the value of the chest from your friend. So no matter what your bid is, the chest values can be [0, B], and therefore the expected value of any given chest you win is E(V) = B/2. Your friend pays you 1.5 * V, so E(1.5 * V) = 1.5 * E(V) = 1.5 * B / 2 = 0.75 * B.
...
Your E(V) is only maximally B/2 @V=B, when V=0 your E(V)=-B so integrating area under curve (which is a striaght line) that distribution get's you -B/4
Then combined with the chance of getting this far its *B/1000
 
I don't believe that this line of thought is correct; note that we have control over B (so it is a fixed constant which we try to determine) while V is a random variable that is *totally independent of V.* This last part is very important; because B and V are independent, it is impossible for E[V] = B/2, as it implies that B and V are dependent -- to see why this is the case, this line of thought suggests that if we bid B = 0, then the value of the treasure chest MUST be V = 0, which doesn't make sense.
?

E & V are independent - but this is why I drew the analogy to throwing two independent dice....
The chance of dice2 = dice1 is the same as a single dice being = a fixed number 1-6.

1. If V is flat distribution then chance to win is B/1000 (doesn't mean we necessarily make a profit though - bit of poison chalice...)
-test edge cases - if we bet maximum 1000 we always win
- if we bet 0 we never win unless value is 0 (but we still make 0- so this edge case doesn't matter)
- if we bid 500 =chance to win is 500/1000 = 1/2 which it would be if V is flat in range 0-1000
- or 200, or 300, or 793.6 etc chance to win is B/1000

2. Now that we have 'won' (for those B/1000 times or more preciesely with B/1000 probability) then it is 100% certain that V must be [0,B] (or we wouldn't have won).

Then, by observation we see we only make profit when V is in top 1/3rd of range [0 B] - and only win B/2 maximally. So already we have only 1/3 of a chance to make profit - now, does this outweigh the potential loss when V is in bottom 2/3 of B?

On other hand we can lose 2/3rd of possible values V can take. AND we lose up to our whole bet/bid B. Since it is a straight line there is no 'hump', maximum or minimum or sweet spot where we can set B - in fact everything is references to B so regardless of the price range of B (say, up to infinity?) - therefore its still always a bad bet.

We can work out the distribution of profit for these B/1000 cases where V<B by definition. according to the graph.
We can integrate 0-B to get Expected profit for these winning cases (that's where the 1/B fiddle factor comes in) to get -B/4

Then multiply by the probability of actually winning in the first place * B/1000

Now if the friend wins a lottery and offers you double the value then the graph above intersection with axis (you still only win B/1000 cases tho') is at B/2 - you can win up to +B or lose down to -B (lose up to B?) with 50% probability each. So its a zero long term prospect now.

So the moral of the story is - be the original seller of the chest.
 
Last edited:
I don't believe that this line of thought is correct; note that we have control over B (so it is a fixed constant which we try to determine) while V is a random variable that is *totally independent of V.* This last part is very important; because B and V are independent, it is impossible for E[V] = B/2, as it implies that B and V are dependent -- to see why this is the case, this line of thought suggests that if we bid B = 0, then the value of the treasure chest MUST be V = 0, which doesn't make sense.
It turns out that B and V are not independent. What is the probability of V being $1000 if you bid $1 and win? The answer is a resounding 0% chance.

I suppose for the sake of accuracy I should make it clear that E[V] = 500, and E[V | win] = E[V | B >= V] = B / 2. V cannot exceed B given that a win occurs. That is an explicitly dependent relationship.

As to your argument that if B is $0 then V must be $0, it's true... given that you win the bid.

Your E(V) is only maximally B/2 @V=B, when V=0 your E(V)=-B so integrating area under curve (which is a striaght line) that distribution get's you -B/4
Then combined with the chance of getting this far its *B/1000
It's true that your chance of winning is B/1000, but that answers a different question (specifically, what is the expected profit when playing the game 1 time).
 
Last edited:
...
It's true that your chance of winning is B/1000, but that answers a different question (specifically, what is the expected profit when playing the game 1 time).
"What should your bid be? "
Now we know whats going to happen, and assuming we are rational, then our bid should be $0, profit & loss is $0.
 
Hmm, just went over the above posts and revisited the question -- you're right. The expected value is -B^2/4000. This is a bit tricky. Here's an alternate explanation I came up with:

We're trying to maximize E[net gain] = E[net gain | lose auction] * p(lose auction) + E[net gain | we win] * p(win auction) = E[net gain | we win] * p(win auction), since E[net gain | lose auction] = 0. We have that: p(win auction) = B / 1000. Now, here's the tricky part. We have that:

E[net gain | we win] = E[1.5 V - B | we win] = 1.5 * E[V | we win] - B

As mentioned earlier, we have that E[V | we win] = B / 2; this is because we must have that V lie in [0, B], and in expectation V will be B/2 (this is assuming a uniform prior on V). Substituting, we have E[net gain | we win] = -B/4, so E[net gain] = B/1000 * (-B/4) = -B^2 / 4000.

The mistake that I made earlier was that rather than computing E[V | we win], I computed E[V] and substituted, which yielded E[net gain | we win] = 750 - B, yielding the incorrect answer of 375.

A comment on independence: the variables B and V are independent of each other BEFORE the result of the auction is announced -- this makes sense, because you haven't met the auction holder at any point before. However, AFTER the result of the auction is announced, the variables B and V are dependent: if you win the auction, we know that B >= V and if you lose the auction, we know that B < V. If we don't account for this dependence after the announcement, we get 375. If we do, we know that the best strategy is to never play this game. :)
 
Back
Top