Former Microsoft boss' favourite interview question

backstreetboy

Honorary Master
Joined
Jun 15, 2011
Messages
37,687
in-what-was-arguably-ballmers-most-memorable-moment-the-then-microsoft-ceo-jumped-up-on-a-stage-yelling-and-dancing-before-beginning-a-presentation-at-an-early-2000s-microsoft-event-many-people-refer-to-the-moment-as-ballmers-monkey-boy-dance-.jpg
 

Thor

Honorary Master
Joined
Jun 5, 2014
Messages
44,240
Yea that was a waste of time.
He failed to address risk appetite. (he said the answer he wants is for the person to say no)

I know from a mathematical point of view to not play that game, but I also know myself and I am willing to take the risk.
 

G.A.S

Senior Member
Joined
Jul 12, 2007
Messages
957
Yea that was a waste of time.
Agreed. That said, even with the most evil non-random number, using a binary search will only lose you $1. Otherwise - with a random number - your odds are as follow:
1% - Win $5
2% - Win $4
4% - Win $3
8% - Win $2
16% - Win $1
32% - Break even
37% - Lose $1

In this case 52 would lose $1 if you round your guesses down and break even if you round your guesses up or to the closest integer.
 
Last edited:

cguy

Executive Member
Joined
Jan 2, 2013
Messages
8,533
Yea that was a waste of time.
He failed to address risk appetite. (he said the answer he wants is for the person to say no)

I know from a mathematical point of view to not play that game, but I also know myself and I am willing to take the risk.

It’s not really about risk - betting on something with a negative expectation is never a good idea. Risk appetite is about tolerance of variance, not expectation.
 

cguy

Executive Member
Joined
Jan 2, 2013
Messages
8,533
Agreed. That said, even with the most evil non-random number, using a binary search will only lose you $1. Otherwise - with a random number - your odds is as follow:
1% - Win $5
2% - Win $4
4% - Win $3
8% - Win $2
16% - Win $1
32% - Break even
37% - Lose $1

In this case 52 would lose $1 if you round your guesses down and break even if you round your guesses up or to the closest integer.

Thise probabilities aren’t quite right, BTW. (After the 1st one, they’re conditional).
 

MrGray

Executive Member
Joined
Aug 2, 2004
Messages
9,397
I find these stories about tech companies and their gimmicky interview questions somewhat irritating. If it was relevant to the position and you wanted to gauge someone's ability to assess probability and an insight into their reasoning ability, why not just ask the question in a straightforward way, i.e. "What would be the best algorithm to find a specific value in a series of 100 integers, and what is the probability of finding it in under 5 iterations?". Why dress it up as a childish question about making or losing money and then further make an inference based on whether the candidate realises you might be being sneaky or not? It's silly.
 

saor

Honorary Master
Joined
Feb 3, 2012
Messages
34,315
I find these stories about tech companies and their gimmicky interview questions somewhat irritating. If it was relevant to the position and you wanted to gauge someone's ability to assess probability and an insight into their reasoning ability, why not just ask the question in a straightforward way, i.e. "What would be the best algorithm to find a specific value in a series of 100 integers, and what is the probability of finding it in under 5 iterations?". Why dress it up as a childish question about making or losing money and then further make an inference based on whether the candidate realises you might be being sneaky or not? It's silly.
Because their CV already alludes to their technical knowledge. An interview is better suited at gauging the person and their ability to deal with the unknown. When I'm dealing with clients and their requests, they're mostly coming at me in a non-technical language; they're expressing an idea with whatever models they've got available to them. And being able to parse those models & grok the underlying idea is what I understand these kinds of questions to be getting at: The real world is messy, so lets ask messy questions.
 

Swa

Honorary Master
Joined
May 4, 2012
Messages
31,217
It’s not really about risk - betting on something with a negative expectation is never a good idea. Risk appetite is about tolerance of variance, not expectation.
The question is wrong based on assumption. It assumes humans are predictable. First problem "50, 75, 63, then 57", this assumes there can only be one direction the algorithm can go. The number could also be 1. So let's assume worst case scenario if I'm rounding up - 50 ($5), 25 ($4), 13 ($3), 7 ($2), 4 ($1), 2 ($0)

So in this case I would lose $1. If I was rounding down like with a standard int algorithm I would not lose anything. But here's the thing. It assumes you are smart enough to know which number to pick, and as we've seen maths isn't really people's strong point, and all for the possibility of winning $1. But here's the real kicker, what if I don't strictly follow the median method but introduce randomness to reduce your trickery for a more equal random chance of winning or losing $5. You'll already be sweating when I don't pick 50 but 47 instead. It seems to me you are really the one that should not want to play this game.

Microsoft "geniuses" aren't the smartest of the bunch, so what would your response be to this answer where you pick the number but I pick the odds?
 

Peon

Expert Member
Joined
Sep 28, 2006
Messages
3,668
Well atleast its confirmed that the top tech CEO's only care about money, now we understand that person and their motivation.
 

cguy

Executive Member
Joined
Jan 2, 2013
Messages
8,533
I find these stories about tech companies and their gimmicky interview questions somewhat irritating. If it was relevant to the position and you wanted to gauge someone's ability to assess probability and an insight into their reasoning ability, why not just ask the question in a straightforward way, i.e. "What would be the best algorithm to find a specific value in a series of 100 integers, and what is the probability of finding it in under 5 iterations?". Why dress it up as a childish question about making or losing money and then further make an inference based on whether the candidate realises you might be being sneaky or not? It's silly.

He's not trying to (just) figure out whether or not you know an algorithm for a binary search, he's trying to figure out if you realize that this is an adversarial situation, and that if you can guess your opponents strategy, you can do better than a binary search. Also, on the technical side, he is interested in whether or not you can make the statistical argument that (a) under the assumption of random selection, the game is not worth playing, and (b) if the proposed strategy was being used, that statistically, it would be worth playing.
 

cguy

Executive Member
Joined
Jan 2, 2013
Messages
8,533
The question is wrong based on assumption. It assumes humans are predictable. First problem "50, 75, 63, then 57", this assumes there can only be one direction the algorithm can go. The number could also be 1. So let's assume worst case scenario if I'm rounding up - 50 ($5), 25 ($4), 13 ($3), 7 ($2), 4 ($1), 2 ($0)

So in this case I would lose $1. If I was rounding down like with a standard int algorithm I would not lose anything. But here's the thing. It assumes you are smart enough to know which number to pick, and as we've seen maths isn't really people's strong point, and all for the possibility of winning $1. But here's the real kicker, what if I don't strictly follow the median method but introduce randomness to reduce your trickery for a more equal random chance of winning or losing $5. You'll already be sweating when I don't pick 50 but 47 instead. It seems to me you are really the one that should not want to play this game.

Microsoft "geniuses" aren't the smartest of the bunch, so what would your response be to this answer where you pick the number but I pick the odds?

He's not specifically assuming that there is one direction (well, path ctually), rather he's saying that as an adversary, he would try to choose a number that would cause the median method to lose. So, choosing 50 would be the worst number, 75 or 25 would be the second worst numbers, etc.

If one can guess that his strategy is to choose a number that yields a poor result for the median method, you could modify the algorithm to first choose the median from this set of worst numbers, and binary search this smaller set, in which case you may actually statistically (under the condition of the above strategy being used) be able to win the game.

If you introduce randomness to your selection, the expectation would be the same number of steps as for a binary search, which would mean that on average you would lose, and should choose not to play.
 
Last edited:

G.A.S

Senior Member
Joined
Jul 12, 2007
Messages
957
Thise probabilities aren’t quite right, BTW. (After the 1st one, they’re conditional).
I tested every number from 1-100, those are the probabilities (rounding up or down makes a 1% difference somewhere).
 

Swa

Honorary Master
Joined
May 4, 2012
Messages
31,217
He's not specifically assuming that there is one direction (well, path ctually), rather he's saying that as an adversary, he would try to choose a number that would cause the median method to lose. So, choosing 50 would be the worst number, 75 or 25 would be the second worst numbers, etc.

If one can guess that his strategy is to choose a number that yields a poor result for the median method, you could modify the algorithm to first choose the median from this set of worst numbers, and binary search this smaller set, in which case you may actually statistically (under the condition of the above strategy being used) be able to win the game.

If you introduce randomness to your selection, the expectation would be the same number of steps as for a binary search, which would mean that on average you would lose, and should choose not to play.
That's not what he's looking for. He's looking for one (yes or no) answer based on the median method being the best yield of information. He's ignoring that a gambler would not use the best algorithm for gleaning information but the one that yields the best (or even) odds, that's randomness. He's not considering that the method determined the odds and only that he's likely controlling the outcome based on the odds.

I also don't agree with the last bit. If I use randomness I may lose $5 but my chances for that overall would be the same as winning $5.
 

cguy

Executive Member
Joined
Jan 2, 2013
Messages
8,533
I tested every number from 1-100, those are the probabilities (rounding up or down makes a 1% difference somewhere).

Probability of getting it right on the 1st guess:
1/100

Probability of getting it right on the 2nd guess:
(99/100)*(1/49.5) = 2%.
etc.

(Probability of getting it wrong on the first go, multiplied by probability of getting it right on the second go)

So, yeah, you're absolutely right. I was thinking second "random" guess, but didn't account for the factor of 2 division known because you also get too High vs too Low. I should have done this on paper! :)
 

Johand

Expert Member
Joined
Jan 21, 2005
Messages
2,184
These brain teaser questions are useless for interviews and are usually asked by people who think too much of themselves. A lot of those questions are actually answered correctly by somebody that got to hear the trick once before.

Real interviewers usually ask questions like "what is the most difficult coding problem you solved and explain how you went about solving it". It reflects your critical thinking, your experiece, the structure you apply to solving problems etc etc and doesnt rely on smarty pants trick questions. Example - A lot of really bright people answer the Monty Hall problem incorrectly and a lot of really dumb people get it correct not because they can solve it but because they read or were told about it.

If these trick questions worked then quiz show contestants would have been the most successful people in the world..
 
Top