Puzzles, riddles, logical questions, and lateral thinking questions are integral part of any programming job interviews. I missed to include some puzzles, when I shared my list of top 30 programming interview questions earlier, and couple of my friends requested to share some puzzles as well. These puzzles and lateral thinking questions are mostly collected from various Java programming interviews on Investment banks, but they are equally useful to any programming job interviews. I have seen more puzzles and logical questions at junior level i.e. 2 to 4 years. These kinds of puzzles, if asked at the beginning of interview, can make or break the interview. It’s not easy to solve them, especially when you see them first time, but what is surely not to do is give up without try, even if you can't think of answer, try to show rational approach. Remember it's OK, if you don't answer any puzzle question, but your approach towards unknown problem get noticed. At the same time lateral thinking questions offers several answers, and you can give your own explanation as well, but make sure it must look genuine and seems logical. Puzzles and riddles also forms a big chunk of Microsoft and Google Interview questions as well, and they are some really nasty and tough to answer. Anyway, I have not provided answers of these puzzles and logical questions, so that you can at least give it a try. Immediate answers kill the purpose of puzzles and riddles, and it's fun to solve them by yourself. By the way, you can easily find answers of these puzzles using Google, as they have asked numerous times on various programming interviews on software and technology companies.
10 puzzles, riddles, logical and lateral thinking question
Here is my list of 10 riddles, puzzles, logical and lateral thinking questions. Try to solve it by yourself before searching for answers in Google, they are not that tough or difficult. Easy answers spoils purpose of puzzles, so don’t look at them, until you are going for interview very next day.
1) There are 27 coins and a two-pan balance. All coins has same weight except for one, which is heavier than all others. All coins looks identical. What is the minimum number of weighing required to certainly find out heavier coin?
2) There are two sticks which takes one hour to burn from one end to other. The sticks do not burn at a constant rate i.e. some part may burn faster than others. You need to measure 45 minutes by using these two sticks and a lighter.
3) Two persons are walking into a railway tunnel. Upon crossing 2/3rd of the tunnel, they saw train is coming from opposite direction. Each person ran for a different end of tunnel with speed of 10 km per hour. Fortunately, both persons escaped from the tunnel just right time i.e.. at the time train would have run through them. Assuming train was running with a constant speed and both persons reacted immediately, Find out speed of train.
4) There are thee switches outside of a closed room to operate three different light bulb inside the room. You can only go into the room once and you need to determine which switch belongs to which bulb. Just to make it clear, room is perfectly locked and its not possible to determine whether lights are on from outside the room.
5) You have 10 Jars filled with marbles. Each marble weighs 10 gm, except one Jar which contains defective marbles which weighs 9 gm. Given a scale to weigh, How do you find Jar with defective marbles in just one measurement. Here scale is modern day electronic scale to measure weight.
6) A person shoots her wife. Then holds her under water for 5 minutes. Finally, he hangs her. But after 10 minutes they both go out together and enjoy a wonderful dinner together. How can this be?
7) A father and son are going in a car and suddenly there car met accident. Father died on the spot but the child rushed to the hospital. When he arrives in the hospital, doctor says, "I can't operate on this child, he is my son!" How can this be?
8) You have a 5 liter Jug and a 3 liter Jug and unlimited supply of water. You need to measure exactly 4 liter of water but there is no measuring instrument or cup. Also Jugs are oddly shaped and doesn't contain any mark.
9) There are Four people needs to cross the bridge during night. The bridge can hold the weight of two people at a time and can not be crossed without a torch. Each person walk with different speed, first can cross the bridge in 1 minutes, second in 2 minutes, third in 5 minutes and fourth take 10 minutes to cross the bridge. If two persons go together, they walk with the speed of slower person. What is the least amount in which all four people cross the bridge.
10) A person's age is many days as his father's age in weeks and as many month as his grand father's age in years. If you combine age of all three it comes 120 years. What is the age of all three?
That's all on this list of top 10 puzzles, riddles, logical questions and lateral thinking questions asked in programmer interviews. These question has maximum impact when programmer doesn't heard about it, and it means they may appear differently in actual interview. As a candidate, you can prepare all these question to get your mind working and knowing some techniques to solve them, but be prepare for surprise in actual Interview. Key of solving puzzles, logical questions or riddles are keeping your cool and not panicking. Even if you don't know answer you should start explaining your way and logic and if you have any answer which is out of box then better say it. Many times it happen when candidates are selected even if they don't solve the puzzles but in the process show some promise.