The Magic Bird

Here's a question I was asked as part of an interview:

Two cars, A and B, enter the same tunnel from opposite ends. The tunnel is 200 km long. The cars are each going 100 km/h. A magical bird takes off from car A and flies at 1000 km/h towards car B. When it reaches car B, it immediately turns around and flies back to car A. When it reaches car A, it turns around and flies back to car B, etc.. The bird keeps flying back and forth until the cars collide, killing everyone, including the bird.

How far did the bird fly ?

11 thoughts on “The Magic Bird

  1. joel hanes

    the cars collide in one hour

    therefore the bird flies for one hour

    the bird flies magically at 1000 kph
    (may we also assume it magically
    loses no time turning around ? )

    1000 kilometres per hour for one hour

    therefore the bird flies 1000 kilometres

  2. Jeffrey Kramer

    The alternative method to Joel’s would involve using differential calculus to solve for each segment of the bird’s flight.

    I once read a story, supposedly true, of a math instructor asking this question of a student who later went on to fame in the field (don’t remember their names). The student gave the answer immediately, and the teacher nodded in approval, saying “Ah, you see the shortcut.” The student looked puzzled and responded “there’s a shortcut?”

  3. hate story problems

    Here’s a question I was asked as part of an interview:

    really ?

    i would have laffed and said you can stick your stoopid little story problem up yer azz.

    jeebus

  4. Ugh

    I would have noted that there is nothing that tells me when the bird took off. Also nothing indicates that there were drivers of the cars, so “killing” (is that the right legal term in this instance?) “everyone” could be misdirection. Plus, is there really a manufacturer that has named its cars “A” and “B”? Finally, was it an African or European magical bird?

  5. russell

    joel hanes wins the prize for coming up with a good and useful answer, fast, without getting bogged down.

    That said….

    Questions like this in interviews always strike me as some kind of weird “gotcha” trip. It’s like the interviewer is trying to figure out if I’m a clever little tricksy devil like he or she is.

    I don’t like working with, or for, clever little tricksy devils.

    I like to hear questions about what I’ve built. What was good about the product, what was not so good, how did it fit (or not) into the intended market. What was hard about it, how was the hard part solved.

    Playing puzzles don’t make money. Putting good products in the market makes money. It’s fun to work for a company that’s making money, cause it means I get to have some, and I get to keep on having a job.

    I’m thinking you dodged a bullet if this doesn’t pan out.

    That’s my take.

  6. Cris

    Playing puzzles don’t make money. Putting good products in the market makes money.

    I don’t know, was it an interview with Games magazine?

  7. cleek

    I’m thinking you dodged a bullet if this doesn’t pan out.

    it didn’t. and because it didn’t, i’m going to share some more of the questions they asked!

    It’s like the interviewer is trying to figure out if I’m a clever little tricksy devil like he or she is.

    exactly.

    they asked a bunch of programming questions, too (reverse a string, convert a string to an integer, write tree-traversal functions, etc.). those all seemed simple, compared to the logic puzzles.

  8. cleek

    and, yes, joel is correct.

    it took me a while to get it, though. i figured out the 1 hour part right off, but stared at the 1000 km/h for a while without making the connection.

Comments are closed.