News for hackers. Stuff that matters.
Re:Ask HN: What is your favourite technical interview question? by djb_hackernews on Thursday October 28, 2010 @01:55PM (#1844028)
Not my favorite, but interesting:

You are given two eggs and a hundred story building. You need to tell me, using as few drops as possible, what the highest floor you can drop an egg from and it won't break.

Re:Ask HN: What is your favourite technical interview question? by babycakes on Thursday October 28, 2010 @10:33PM (#1845819)
While I appreciate the inductive nature of this problem, this problem is more likely to demonstrate that the candidate has done a Google search for interview questions (http://www.google.com/search?q=google+interview+questions) than an understanding of algorithmic theory.
Re:Ask HN: What is your favourite technical interview question? by spokey on Thursday October 28, 2010 @03:27PM (#1844509)
Is the answer you're looking for a binary search algorithm, or do you have some lateral thinking solution in mind?
Re:Ask HN: What is your favourite technical interview question? by MountainDrew on Thursday October 28, 2010 @04:16PM (#1844750)
Because you only have 2 eggs I don't think you can use a binary search algorithm (assuming I understood the question correctly). I think you'd have to start at floor 2, if that passed then jump to floor 4, etc. until you have an egg break (lets call this floor n). Then, you go to the floor below the one that broke the egg to see if an egg survives that drop. You'll then know, using only 2 eggs the highest floor you could drop from without breaking an egg (either n, n-1, or n-2).
Re:Ask HN: What is your favourite technical interview question? by spokey on Thursday October 28, 2010 @04:31PM (#1844821)
Spot on. I missed the 2 part, which makes this question much more interesting. By the way, I think I do could it in one drop; drop one from floor 1. If it breaks the answer is 0, else 1 because I don't think many eggs could survive a two story drop.
Re:Ask HN: What is your favourite technical interview question? by djb_hackernews on Thursday October 28, 2010 @05:13PM (#1844994)
close. Suppose the answer is 99? How many drops would it take to figure that out? Could you do it in less?