Krazy Kaksha

Interview Prep

15 Puzzles Asked in Placement Interviews (With Simple Answers)

Krazy Kaksha 4 min read

15 Puzzles Asked in Placement Interviews (With Simple Answers)

Many companies ask one or two puzzles in the technical or HR round. They are not checking if you know the answer; they want to see how you think out loud. Learn these 15 classics, and practise explaining each in under a minute.

1. Two jugs: measure 4 litres

Puzzle: You have a 3-litre and a 5-litre jug and unlimited water. Measure exactly 4 litres.
Answer: Fill 5 L. Pour into 3 L (5 L now has 2). Empty 3 L. Pour the 2 L into 3 L. Fill 5 L again. Pour into 3 L until full (needs 1 L). Now 5 L jug has 4 litres.

2. Burning ropes: measure 45 minutes

Puzzle: Two ropes each take 60 minutes to burn, but burn unevenly. Measure 45 minutes.
Answer: Light rope A at both ends and rope B at one end. A finishes in 30 minutes. Then light the other end of B; the remaining 30 minutes of B burn in 15. Total 45 minutes.

3. 25 horses, 5 tracks: find the top 3

Puzzle: 25 horses, 5 can race at a time, no timer. Minimum races to find the fastest 3?
Answer: 7 races. 5 races for 5 groups. Race 6: the 5 group winners; the winner is fastest overall. Race 7: 2nd and 3rd from the winner’s group, 1st and 2nd of the second-place group, and the winner of the third-place group. The top 2 of race 7 are 2nd and 3rd overall.

4. 8 balls, one heavier, a balance scale

Puzzle: Find the heavier ball in the fewest weighings.
Answer: 2 weighings. Weigh 3 vs 3. If equal, weigh the remaining 2 against each other. If not, take the heavier 3 and weigh 1 vs 1; if equal, the third is heavy.

5. 100 doors

Puzzle: 100 closed doors. Person 1 toggles every door, person 2 every 2nd door, and so on up to person 100. Which doors are open?
Answer: Doors with an odd number of factors, which are perfect squares: 1, 4, 9, 16, 25, 36, 49, 64, 81, 100. 10 doors are open.

6. Three switches, one bulb

Puzzle: Three switches outside a room, one controls the bulb inside. You can enter the room only once.
Answer: Turn switch 1 on for 5 minutes, turn it off, turn switch 2 on, then enter. Bulb on = switch 2. Off but warm = switch 1. Off and cold = switch 3.

7. Bridge and torch

Puzzle: Four people take 1, 2, 5 and 10 minutes to cross a bridge. At most two cross at a time with one torch. Minimum time?
Answer: 17 minutes. 1 and 2 cross (2). 1 returns (1). 5 and 10 cross (10). 2 returns (2). 1 and 2 cross (2). 2 + 1 + 10 + 2 + 2 = 17.

8. Clock angle at 3:15

Answer: Minute hand at 90 degrees. Hour hand at 90 + 15 x 0.5 = 97.5 degrees. Angle = 7.5 degrees. Formula: |30H – 5.5M|.

9. Cutting a cake into 8 pieces with 3 cuts

Answer: Two cuts in a plus shape from the top make 4 pieces, then one horizontal cut through the middle makes 8.

10. Poisoned wine bottle

Puzzle: 1000 bottles, one poisoned. Poison acts in 24 hours. Minimum testers to find it in one day?
Answer: 10 testers, using binary: number bottles 1 to 1000 in binary; tester i drinks from every bottle with bit i set. The pattern of who falls sick gives the bottle number (2^10 = 1024 is at least 1000).

11. Coins on a table (blindfolded)

Puzzle: 100 coins, 10 heads up. Blindfolded, split them into two groups with equal heads.
Answer: Take any 10 coins as group A and flip all of them. Group A and the remaining 90 now have the same number of heads.

12. The missing rupee

Puzzle: Three friends pay Rs 10 each for a Rs 30 room. The owner returns Rs 5; the boy keeps Rs 2 and gives Rs 1 each back. They paid Rs 27, the boy has Rs 2: Rs 29. Where is Rs 1?
Answer: Nothing is missing. The Rs 27 already includes the boy’s Rs 2 (Rs 25 room + Rs 2). Add the Rs 3 returned to get Rs 30.

13. Handshakes in a room

Puzzle: 10 people, each shakes hands once with every other.
Answer: n(n-1)/2 = 10 x 9 / 2 = 45 handshakes.

14. Find the fake coin stack

Puzzle: 10 stacks of 10 coins. One stack has fake coins of 9 g instead of 10 g. One weighing on a digital scale.
Answer: Take 1 coin from stack 1, 2 from stack 2 … 10 from stack 10 (55 coins). Expected weight 550 g. The shortfall in grams = the fake stack number.

15. Egg drop (2 eggs, 100 floors)

Puzzle: Find the highest safe floor with 2 eggs in the fewest drops in the worst case.
Answer: 14 drops. Drop from floors 14, 27, 39, 50, 60, 69, 77, 84, 90, 95, 99, 100 (each jump one less). When the first egg breaks, check the floors in between one by one with the second egg.

How to answer puzzles in an interview

  1. Repeat the question in your words and confirm limits.
  2. Think aloud: start with a small or simple case.
  3. If stuck, give a working answer first, then improve it.
  4. Check your answer with an example.

Also revise the Operating System, DBMS and Computer Networks questions for the technical round.

Doubts? Ask here

Leave a comment

Your email is not shown. Comments appear after a quick check.