<p>One of those classic programming interview questions...</p>

<p>You are given two marbles, and told that they will break when dropped from some certain height (and presumably suffer no damage if dropped from below that height). You’re then taken to a 100 story building (presumably higher than the certain height), and asked to find the highest floor your can drop a marble from without breaking it as efficiently as possible.</p>

<p>Extra info</p>

<ul>
<li>You must find the correct floor (not a possible range)</li>
<li>The marbles are both guaranteed to break at the same floor</li>
<li>Assume it takes zero time for you to change floors - only the number of marble drops counts</li>
<li>Assume the correct floor is randomly distributed in the building</li>
</ul>

They each break when dropped from the same height, or are they different?
If they're the same, I go to the 50th floor and drop the first marble.  If it doesn't break, I go to the 75th floor and do the same, as long as it keeps not breaking I keep going up by 50% of what's left.  When it does break, I go back to one higher than where I was previously (so if it broke at the 75th floor I go back to the 51st floor) and drop the second marble and move up a floor at a time until it breaks, at which point I know the highest floor I can drop from with no marble breakage.
Probably not the best answer, I'm curious to see how others answer.