Google Interview Questions
21–30 of 37 posts
Re: Google Interview Questions
#22Hi5 SDE used to get asked the "How Strong is an Egg?"/"Drop Two Bowling Balls from a building" question. Not sure how this proves anything.
just wondering for this question("how strong is an egg"), i think binary search will be the minimum tries, so its quite useful.
The solution, once found, is simple to prove optimal, but most people don't seem to know how to do that.
Most people don't find it.
Re: Google Interview Questions
#23I got the 5 pirates one when I interviewed at Trilogy.
I hate that one. It seems to rely on these "pirates" being hardcore mathematical logicians and rule-followers. Can you imagine a pirate, one out of five, "suggesting" that a good distribution was him 98, two of the others 1 each, and the other two zero? WTF? I'd cut off his head on pure principle! A better "real world" solution would be 40 + 30 + 15 + 10 + 5 or something.
Humans, especially Pirates don't care about maths in these kind of scenarios, zero gold would be considered an insult.
Re: Google Interview Questions
#24Re: Google Interview Questions
#25I got the 5 pirates one when I interviewed at Trilogy.
I hate that one. It seems to rely on these "pirates" being hardcore mathematical logicians and rule-followers. Can you imagine a pirate, one out of five, "suggesting" that a good distribution was him 98, two of the others 1 each, and the other two zero? WTF? I'd cut off his head on pure principle! A better "real world" solution would be 40 + 30 + 15 + 10 + 5 or something.
Imagine if the interviewer instead asked "Convince me you know induction." as that's what they are really after. Without a framework to hang the answer on, it becomes a lot harder.
It's a bad question because it has fallen into the "riddles with memorized answers" category, but not because the skills necessary to solve it are useless.
Re: Google Interview Questions
#26Earlier quoted context omitted.
just wondering for this question("how strong is an egg"), i think binary search will be the minimum tries, so its quite useful.
That turns out not to be the case. Binary search doesn't help, binary doubling doesn't help, even though these are often thought to be the best. Indeed, the solution given on this site used binary doubling and claimed it to be optimal. It was wrong. It was posted here some time ago. The solution, once found, is simple to prove optimal, but most people don't seem to know how to do that. Most people don't find it.
Re: Google Interview Questions
#27Re: Google Interview Questions
#28Earlier quoted context omitted.
That turns out not to be the case. Binary search doesn't help, binary doubling doesn't help, even though these are often thought to be the best. Indeed, the solution given on this site used binary doubling and claimed it to be optimal. It was wrong. It was posted here some time ago. The solution, once found, is simple to prove optimal, but most people don't seem to know how to do that. Most people don't find it.
For N balls, the other balls can/should be binary searched. It's just a little tricky when it comes to the last two..
> For N balls, the other balls can/should be binary searched.
Interesting assertion. Can you prove that? Can you give a provably minimal search pattern? > It's just a little tricky when it comes to the last two.
Another interesting assertion. It seems to me that the case of exactly two balls is trivial, once the solution is found.Re: Google Interview Questions
#29Earlier quoted context omitted.
I hate that one. It seems to rely on these "pirates" being hardcore mathematical logicians and rule-followers. Can you imagine a pirate, one out of five, "suggesting" that a good distribution was him 98, two of the others 1 each, and the other two zero? WTF? I'd cut off his head on pure principle! A better "real world" solution would be 40 + 30 + 15 + 10 + 5 or something.
Not that I ask it, but it's a question about induction, not psychology. They are "pirates", not pirates. Imagine if the interviewer instead asked "Convince me you know induction." as that's what they are really after. Without a framework to hang the answer on, it becomes a lot harder. It's a bad question because it has fallen into the "riddles with memorized answers" category, but not because the skills necessary to…
I dig where you're coming from but this is kind of my whole point. Humans are humans, you cannot just ignore psychology. You are being asked to predict human behaviour. The "correct" answer is ridiculously unrealistic. Who is better - the guy who is competent at induction, or the guy who realises that human interaction is rarely, if ever, guided by such black and white rules?
Re: Google Interview Questions
#30Earlier quoted context omitted.
For N balls, the other balls can/should be binary searched. It's just a little tricky when it comes to the last two..
> For N balls, the other balls can/should be binary searched. Interesting assertion. Can you prove that? Can you give a provably minimal search pattern? > It's just a little tricky when it comes to the last two. Another interesting assertion. It seems to me that the case of exactly two balls is trivial, once the solution is found.
Well, it is trivial with two balls, once you get it, but it's tricky with respect to "just binary search".