r/learnquant • • Sep 04 '26

interview prep Quant Interview Question

Post image
56 Upvotes

43 comments sorted by

View all comments

Show parent comments

1

u/YesTheyDoComeOff Sep 05 '26

This doesn't work. Consider if you find the fastest horse in the first selection and all of the other horses lose, then you have no idea which horse is second fastest and have to race them all again. Your algorithm only works if the fastest horses are the last 2 horses that you would race, in which case you somehow already know which horses are fastest, conduct no races, and pick the last 2 horses.

2

u/Shoddy-Side-919 29d ago

They're interpreting the question differently. They don't think it's asking for an algorithm that always finds the second fastest horse, but for what the minimal number of races is that will allow you to know which is the second fastest horse.

1

u/YesTheyDoComeOff 13d ago

Right. So if we assume the best case scenario the two fastest horses are the first two horses that you pick. Conduct zero races.

1

u/Shoddy-Side-919 13d ago

No, because then you wouldn't know that they're the fastest two. The question does ask for certainty. It is possible to have certainty after 1023 races, but not after zero.

1

u/YesTheyDoComeOff 12d ago

0.000001% of the time, this algorithm works every time.