Live data from Hacker News

Quant Job Interview Questions (2009) [pdf]

math.kent.edu

71–80 of 154 posts

Re: Quant Job Interview Questions (2009) [pdf]

#71
Questions 8 and 9 remind me of a math YouTube video I saw recently about "weird" infinite series that can sometimes be solved quite easily.

IIRC Consider sqrt(x+sqrt(x +... = x

You need to check the series converges (this can sometimes be tricky but seems the questions tell you they converge). Then you can do this substitution for the infinite piece:

sqrt(x+x) = x

x^2 = 2x

x^2 - 2x = 0

...

y = 1/(1+y)

[IIRC there are situations where a different substitution yields a different result - I don't recall the details]

Re: Quant Job Interview Questions (2009) [pdf]

#72

Here's my favorite interview question (spent 10 years as a quant, interviewed a bunch of people, most do not do well on this) We're going to play a game. You draw a random number uniformly between 0 and 1. If you like it, you can keep it. If you don't, you can have a do-over and re-draw, but then you have to keep that final result. I do the same. You do not know whether I've re-drawn and I do not know whether you've…

Alternative option: spend time on other things because quants are about the big bucks

Re: Quant Job Interview Questions (2009) [pdf]

#74
post #73

Energy trading quant here. If anyone interviewed me with this crap I'd walk out immediately.

Care to elaborate?

I guess those Ramanujan-like infinite series are a bit like trivia questions, right? Does anyone really have an intuition to solve something like that?

Re: Quant Job Interview Questions (2009) [pdf]

#75
post #68

Earlier quoted context omitted.

Consider heads or tails: you get two flips, what are your chances of getting heads at least once? 50% for the first time then theres 50% chance you didn't, of that you now have a 50% chance to still get it .5*.5=.25. so for the two chances p(1)=.5, p(2)=.25, therefore overall p1+p2=.75 for redrawing at <50% or getting heads once with two tries.

You are agreeing with my solution? Though in this problem it seems the "average" final number would be 0.625, not 0.75 - since half the time you have an 0.75 expected outcome and the other half a 0.5 expected.

No, having 2 chances obviously increases the probability. I don't see what you're averaging, but the formula for probability of an outcome of 2 unrelated events by the general addition rule is p(1 or 2) = (p1 + p2) - (p1*p2). in this case .5+.5-.25=.75; I was just trying to phrase it in an intuitive way.

Re: Quant Job Interview Questions (2009) [pdf]

#76

Here's my favorite interview question (spent 10 years as a quant, interviewed a bunch of people, most do not do well on this) We're going to play a game. You draw a random number uniformly between 0 and 1. If you like it, you can keep it. If you don't, you can have a do-over and re-draw, but then you have to keep that final result. I do the same. You do not know whether I've re-drawn and I do not know whether you've…

This seems so simple. Decisions and draws are independent - we can ignore the other guy and just go for the highest value. Draw the first number. If it's below 0.5, draw again, since the odds then are that the next draw will be higher. Is there more?

That was my analysis as well. What the other guy does is unknown and therefore irrelevant. If you can improve your current expectation, you do. You can trivially search over that strategy space and see that, yep, 0.5 is the maximum.

  #include 
  #include 

  int main(int argc, char *argv[]) {
    for (double d = 0.25; d 

Re: Quant Job Interview Questions (2009) [pdf]

#77
post #68

Earlier quoted context omitted.

Consider heads or tails: you get two flips, what are your chances of getting heads at least once? 50% for the first time then theres 50% chance you didn't, of that you now have a 50% chance to still get it .5*.5=.25. so for the two chances p(1)=.5, p(2)=.25, therefore overall p1+p2=.75 for redrawing at <50% or getting heads once with two tries.

You are agreeing with my solution? Though in this problem it seems the "average" final number would be 0.625, not 0.75 - since half the time you have an 0.75 expected outcome and the other half a 0.5 expected.

I think the point is that your strategy isn't independent of your opponent. Maybe a similar example is nontransitive dice: https://en.wikipedia.org/wiki/Nontransitive_dice

In other words, it isn't sufficient to shoot for the highest score possible.

Re: Quant Job Interview Questions (2009) [pdf]

#78

Here's my favorite interview question (spent 10 years as a quant, interviewed a bunch of people, most do not do well on this) We're going to play a game. You draw a random number uniformly between 0 and 1. If you like it, you can keep it. If you don't, you can have a do-over and re-draw, but then you have to keep that final result. I do the same. You do not know whether I've re-drawn and I do not know whether you've…

This seems so simple. Decisions and draws are independent - we can ignore the other guy and just go for the highest value. Draw the first number. If it's below 0.5, draw again, since the odds then are that the next draw will be higher. Is there more?

I was 100% sure that redrawing below 0.5 is optimal, but a simple simulation disagrees:

    def tournament(a, b, n=1000):
        return sum(a() > b() for _ in xrange(n)) / n

    def redraw_below(c):
        x = random.random()
        if x 
`redraw_below(0.5)` only beats `redraw_below(0.6)` 0.4948 of the times, very consistently, over three sets of a million rounds.

This is despite `0.5` giving a better average (0.624 vs. 0.620).

I'll think about why, but the result is very consistent and can't be ignored.

Re: Quant Job Interview Questions (2009) [pdf]

#79

Here's my favorite interview question (spent 10 years as a quant, interviewed a bunch of people, most do not do well on this) We're going to play a game. You draw a random number uniformly between 0 and 1. If you like it, you can keep it. If you don't, you can have a do-over and re-draw, but then you have to keep that final result. I do the same. You do not know whether I've re-drawn and I do not know whether you've…

Oh my god it's the golden ratio! That's so cool!

EDIT: I'll show my work, rot13'd...

Jr pna cnenzrgrevmr n fgengrtl ol n guerfubyq g: gur inyhr gung gur svefg qenj arrqf gb or yrff guna va beqre gb pubbfr gb qenj ntnva. Hfvat guerfubyq g, gur cebonovyvgl bs trggvat yrff guna g vf g^2 orpnhfr lbh unir gb qenj orybj gur guerfubyq gjvpr va n ebj. Gung chgf gur cebonovyvgl bs raqvat hc nobir gur guerfubyq ng 1-g^2.

Gur cebonovyvgl vf havsbez nobir naq orybj gur guerfubyq fb gur cebonovyvgl qvfgevohgvba bs lbhe ahzore vf:

    cqs(k) = { g vs k
(Gur g+1 vf sebz fbyivat gb znxr gur vagrteny sebz 0 gb 1 or 1.)

Fnl lbhe bccbarag hfrf fgengrtl h naq lbh hfr fgengrtl g. Gura jr jnag gb znkvzvmr gur cebonovyvgl gung K~cqs(g) vf terngre guna L~cqs(h). Zngurzngvpn jvyy gryy hf gung vs jr nfx yvxr fb:

    q[g_] := CebonovyvglQvfgevohgvba[Vs[k
Gung tvirf hf gur cebonovyvgl gung g orngf h yvxr fb:

    c[h_,g_] := Cvrprjvfr[{
      {(1+g-(1+g+g^2)*h+(1+g)*h^2)/2,  h>g},
      {(1+g-g^2+(g-g^2-1)*h+g*h^2)/2,  h
Abj jr jnag gur g gung znkvzvmrf gung sbe n tvira h, juvpu jr trg ol gnxvat gur qrevingvir jvgu erfcrpg gb g, frggvat vg gb mreb, naq fbyivat sbe g:

    Fvzcyvsl[Fbyir[Q[c[g, h], g] == 0, g], 0
Fb abj jr unir gur orfg erfcbafr gb na neovgenel fgengrtl g:

    oe[g_] := Cvrprjvfr[{
      {(1+g+g^2)/(2+2*g), g(Fdeg[5]-1)/2}}]
Vs lbh cybg gung lbh frr gung gur orfg erfcbafr vf nyjnlf orgjrra .5 naq .618. Vs lbhe bccbarag nyjnlf xrrcf gurve svefg qenj gura lbh fubhyq hfr n guerfubyq bs .5. (Fnzr vs gurl nyjnlf gnxr gur frpbaq qenj bs pbhefr.)

Ohg gurl jba'g qb gung. Vs gurl hfr n guerfubyq bs 1/2 gurzfrys gura oe[1/2] == 7/12. Ohg gurl jba'g qb gung rvgure. Jung jr jnag bs pbhefr vf gur svkrq cbvag, vr, gur Anfu rdhvyvoevhz, jurer oe[g]==g. Gung, boivbhf va gur cybg, vf g = (Fdeg[5]-1)/2 nxn gur tbyqra engvb!

Re: Quant Job Interview Questions (2009) [pdf]

#80

Here's my favorite interview question (spent 10 years as a quant, interviewed a bunch of people, most do not do well on this) We're going to play a game. You draw a random number uniformly between 0 and 1. If you like it, you can keep it. If you don't, you can have a do-over and re-draw, but then you have to keep that final result. I do the same. You do not know whether I've re-drawn and I do not know whether you've…

This seems so simple. Decisions and draws are independent - we can ignore the other guy and just go for the highest value. Draw the first number. If it's below 0.5, draw again, since the odds then are that the next draw will be higher. Is there more?

- edit: To explain, why not 0.5? Because the probability of your opponent having drawn a smaller number than 0.5 after two attempts is 0.5. A strategy of keeping >=0.5 after the first draw will loose against the optimal strategy on average.
Post reply on HN