Loading…

#186 - Cutting The Gordian Knot

·

#186 - Cutting The Gordian Knot

I ALWAYS BRING EGG

This is a common interview question - and not a great one, in my opinion, because it’s more of a long-form high school math problem than it is a programming problem. The correct answer involves producing and then solving the formula for triangular numbers. The even correcter answer involves basic knowledge of eggs: they will not survive even a one floor drop. The better answer still is to not work for the company that is asking silly math questions to try to measure your programming ability. Although I would award definite style points for “Buy 5 more eggs and do a binary search: my time is worth more than the cost of 5 eggs.”


Transcript

Walt: INTERVIEW QUESTION: YOU ARE GIVEN ACCESS TO TWO EGGS AND A 100-STORY BUILDING. WHAT IS THE MOST EFFICIENT WAY TO DETERMINE THE HIGHEST FLOOR FROM WHICH YOU CAN DROP AN EGG AND IT WON'T BREAK?

Interviewee: EASY. I BROUGHT EGGS FROM HOME. WATCH THIS.
Walt: WAIT- WHY DID YOU BRING

Interviewee: OH LOOK- THE ANSWER IS LESS THAN ONE.
Walt: OUR FLOOR!
[Sound: SPLOT]

[©curtis lassam - cube-drone.com - 2015]

Tagged api-key, comics, cube drone