When I was working at Microsoft in the 1990s, I didn’t usually use logic puzzles as interview questions. But here’s one that I did use every now and then because seeing how the candidate being interviewed approached the problem gave me some insights into how they approach problems in general. There are several variations of the problem but one version goes like this:
There are four men on one side of a canyon and the need to cross a bridge over to the other side. The four men walk at different speeds. Man A is the fastest and takes 1 minute to cross. Man B takes 2 minutes. Man C takes 5 minutes. Man D is the slowest and takes 10 minutes to cross. The bridge will only support the weight of two men at a time. It is night and anyone crossing needs a flashlight to see. The men have one flashlight to share. What is the shortest amount of time necessary for all four men to cross?
There are no tricks here like, "construct a catapult out of the flashlight and . . . " The first thing I’d look for is to see if the candidate qualified the question by drawing a picture of some sort. The next thing I’d look for is for the candidate to start analyzing the problem by trying ANY solution. For example, I’d expect to eventually hear something like, "OK, Suppose Man A and B cross together; that’ll take 2 minutes. Man A goes back with the flashlight; that’ll take 1 minute. Man A and C cross, taking 5 minutes. Man A goes back; 1 minute. Finally Man A and Man D cross taking 10 minutes. That’s a total of 2 + 1 + 5 + 1 + 10 = 19 minutes." A bad sign is when a candidate just stares into space for 15 minutes. Software engineering is often a process of trial and error and good candidates will usually just get started, the point being that even if this is the wrong answer, you’ve gained insight into the nature of the problem. I’d also hope that candidates articulate what’s going on in their heads. I didn’t hold it too much against them if they didn’t talk a lot because not all good engineers are talkers.
Of course there are lots of other things exposed in an interview, such as enthusiasm, general communication skills and so on, but that’s another blog. By the way, in the bridge question, you can do better than 19 minutes. Can you figure out how?
My parent company, Volt Information Sciences, is always looking for software engineers. Check the job listings at http://jobs.volt.com/.