Fresher PrepInterview Preparationbeginner

Puzzles Asked in IT Interviews for Freshers

Ten classic logical puzzles freshers meet in IT interviews, such as the water jugs, the 8 balls and the burning ropes, each with the answer and the reasoning to explain aloud.

Published
TL;DR – Quick Answer

Puzzles in IT interviews test how you think, not what you have memorised. Common ones for freshers include measuring 4 litres with 3 and 5 litre jugs, finding the heavier ball among 8 in two weighings, timing 45 minutes with two ropes, and the three switches and three bulbs. Interviewers care most that you explain your reasoning step by step, even if you need a hint.

On This Page

Puzzles asked in IT interviews for freshers check how you think under pressure. The interviewer is less interested in whether you know the answer and more in whether you can break a problem into steps, test ideas and explain them clearly. This page gives 10 simple, classic puzzles with answers and the thinking behind each.

Try each puzzle for a few minutes before you read the answer. Then practise explaining it aloud.

How to approach a puzzle in an interview

Step What to do
1. Repeat the puzzle Say it back in your own words to confirm the rules
2. Ask questions Check limits, such as "Can I fill a jug partly?"
3. Try a small case Solve a smaller version first if the puzzle is large
4. Think aloud Share each idea, including ones you reject
5. Check the answer Walk through your solution once to confirm it works

Pro tip: If you are stuck, say what you have ruled out. "Weighing four against four does not work, because it tells me only which half has the heavy ball." This shows reasoning and often prompts a useful hint.

The 10 puzzles at a glance

No. Puzzle Main idea
1 Measure 4 litres with 3 and 5 litre jugs Pour and reuse leftovers
2 Heavier ball among 8 in two weighings Split into three groups
3 Time 45 minutes with two ropes Burning from both ends halves the time
4 Three switches, three bulbs Use heat as a second signal
5 Four people crossing a bridge Send the two slowest together
6 Snail climbing out of a well The last day has no slip
7 Angle between clock hands at 3:15 The hour hand moves too
8 Handshakes in a room of 10 Count pairs, not people
9 Bat and ball cost Write the equation, do not guess
10 Three wrongly labelled boxes Start with the box you are sure is wrong

Puzzle 1: The water jugs

Puzzle: You have a 3 litre jug and a 5 litre jug, with no markings, and unlimited water. How do you measure exactly 4 litres?

Answer:

Step Action 5 L jug 3 L jug
1 Fill the 5 L jug 5 0
2 Pour from 5 L into 3 L until full 2 3
3 Empty the 3 L jug 2 0
4 Pour the 2 litres into the 3 L jug 0 2
5 Fill the 5 L jug again 5 2
6 Pour from 5 L into 3 L until full 4 3

The 5 litre jug now holds exactly 4 litres.

The thinking: You cannot measure 4 directly, so look for a leftover you can reuse. Pouring 5 into 3 leaves 2. Storing that 2 in the small jug means it then has room for only 1 more litre, and 5 minus 1 is 4.

Puzzle 2: The heavier ball

Puzzle: You have 8 balls that look the same. One is slightly heavier. Using a balance scale only twice, how do you find the heavy ball?

Answer: Split the balls into groups of 3, 3 and 2.

  1. Weigh 3 against 3. If one side is heavier, the heavy ball is in that group of 3. If they balance, it is in the group of 2.
  2. If it is in a group of 3, weigh any 1 against 1. The heavier side has it, and if they balance, it is the ball you left out. If it is in the group of 2, weigh 1 against 1 and the heavier one is the answer.

The thinking: A balance has three outcomes: left heavier, right heavier or equal. So each weighing should split the balls into three groups, not two. Weighing 4 against 4 wastes the "equal" outcome, because the heavy ball is always on the scale.

Puzzle 3: The burning ropes

Puzzle: You have two ropes. Each takes exactly 60 minutes to burn, but they burn unevenly, so half a rope does not take 30 minutes. How do you measure 45 minutes?

Answer:

  1. Light rope A at both ends and rope B at one end, at the same time.
  2. Rope A burns out after 30 minutes. At that moment, light the other end of rope B.
  3. Rope B had 30 minutes of burning left. With both ends lit, it burns out in 15 minutes.

The total is 30 + 15 = 45 minutes.

The thinking: Uneven burning means you cannot measure by length, only by time. Lighting both ends always halves the remaining time, however uneven the rope is. That gives you 30 minutes, and then 15.

Puzzle 4: Three switches and three bulbs

Puzzle: Three switches outside a closed room control three bulbs inside. You can flip the switches as you like, but you can enter the room only once. How do you find which switch controls which bulb?

Answer:

  1. Turn on switch 1 and wait a few minutes.
  2. Turn off switch 1 and turn on switch 2.
  3. Enter the room.

The bulb that is on belongs to switch 2. The bulb that is off but warm belongs to switch 1. The bulb that is off and cold belongs to switch 3.

The thinking: On and off give only two states, but there are three bulbs. You need a third signal. A bulb that was on recently is warm, which gives you on, off-warm and off-cold.

Puzzle 5: Crossing the bridge at night

Puzzle: Four people must cross a bridge at night with one torch. At most two can cross at a time, and the torch must be carried on every crossing. They take 1, 2, 5 and 10 minutes, and a pair moves at the slower person's speed. What is the shortest total time?

Answer: 17 minutes.

Step Crossing Time Total
1 1 and 2 cross 2 2
2 1 returns with the torch 1 3
3 5 and 10 cross 10 13
4 2 returns with the torch 2 15
5 1 and 2 cross 2 17

The thinking: The obvious plan is for the fastest person to escort everyone, which takes 10 + 1 + 5 + 1 + 2 = 19 minutes. The trick is to send the two slowest people together, so the 5 minute crossing is hidden inside the 10 minute one. The fast pair handles the torch returns.

Puzzle 6: The snail in the well

Puzzle: A snail is at the bottom of a 30 metre well. Each day it climbs 3 metres, and each night it slips back 2 metres. How many days does it take to get out?

Answer: 28 days.

The thinking: The quick answer is 30 days, because the snail gains 1 metre a day. But on the final day it climbs out and does not slip back. After 27 days it is at 27 metres. On day 28 it climbs 3 metres, reaches 30 and is out.

Always check the last step separately in puzzles with a repeating pattern. The same habit helps with loop conditions in code.

Puzzle 7: The clock angle

Puzzle: What is the angle between the hour and minute hands at 3:15?

Answer: 7.5 degrees.

The thinking: Many people say 0, because the minute hand points at 3. But the hour hand has also moved a quarter of the way from 3 to 4.

Hand Calculation Angle from 12
Minute hand 15 minutes x 6 degrees per minute 90°
Hour hand 3 hours x 30° + 15 minutes x 0.5° per minute 97.5°

The difference is 97.5 - 90 = 7.5 degrees. The general formula is |30H - 5.5M| degrees, where H is the hour and M the minutes.

Puzzle 8: Handshakes in a room

Puzzle: Ten people are in a room. Each person shakes hands with every other person exactly once. How many handshakes are there?

Answer: 45.

The thinking: Each person shakes 9 hands, which gives 10 x 9 = 90. But that counts every handshake twice, once for each person in it. So divide by 2: 90 / 2 = 45. The general formula is n x (n - 1) / 2, which is the number of ways to choose 2 people from n.

Puzzle 9: The bat and the ball

Puzzle: A bat and a ball cost ₹110 together. The bat costs ₹100 more than the ball. How much does the ball cost?

Answer: ₹5.

The thinking: The fast answer is ₹10, but then the bat would cost ₹110 and the total would be ₹120. Write it as an equation instead. If the ball costs x, the bat costs x + 100. So x + (x + 100) = 110, which gives 2x = 10 and x = 5. The bat costs ₹105.

This puzzle tests whether you check an answer that "feels" right. That habit matters in aptitude tests too.

Puzzle 10: The wrongly labelled boxes

Puzzle: Three boxes are labelled "Apples", "Oranges" and "Apples and Oranges". Every label is wrong. You can take out one fruit from one box without looking inside. How do you label all the boxes correctly?

Answer: Take one fruit from the box labelled "Apples and Oranges".

  1. That box cannot be mixed, because its label is wrong. So it holds only one kind of fruit. Suppose you pull out an apple: this box is "Apples".
  2. The box labelled "Oranges" cannot hold oranges, and apples are taken, so it is "Apples and Oranges".
  3. The box labelled "Apples" must be "Oranges".

If you pull out an orange instead, swap apples and oranges in the same reasoning.

The thinking: Picking from "Apples" or "Oranges" could give an ambiguous result, because those boxes might be mixed. The "mixed" label is the one box you know holds a single fruit type, so one pick tells you everything.

What interviewers look for

They notice Good sign Poor sign
Understanding Repeats the rules and asks about limits Starts guessing straight away
Reasoning Explains why each step is needed States an answer with no reason
Handling hints Uses a hint to move forward Ignores it or gets flustered
Checking Walks through the answer once Says "done" without checking
Honesty Says if they have heard it before Pretends to solve a memorised puzzle

Common mistakes with puzzles

Mistake Better approach
Giving the first answer that comes to mind Check it with a quick calculation
Thinking in silence Share each idea, even ones you reject
Memorising answers only Learn why each step works, for variations
Spending days on puzzles Keep most of your time for coding and core subjects

For mistakes beyond puzzles, read common mistakes freshers make in interviews.

Puzzles are a small part of most fresher interviews. Use them to practise clear, step-by-step thinking, then spend most of your time on coding and core subjects. The full plan is in how to prepare for a fresher technical interview, and the guide on how to improve problem-solving skills builds the same habits for coding rounds.

Frequently Asked Questions

Do IT companies ask puzzles in fresher interviews?
Some do, especially product companies and some technical or managerial rounds at service companies. Puzzles are less common than coding and core subject questions, so treat them as a smaller part of your preparation. A few hours with classic puzzles is usually enough.
What if I have already heard the puzzle?
Be honest. Say you have seen it before and explain the reasoning rather than just stating the answer. Interviewers often then give a variation, so understanding why the answer works matters more than remembering it.
What if I cannot solve a puzzle in the interview?
Keep talking through what you have tried. Start with a smaller version, test simple cases and ask clarifying questions. Many interviewers give hints and judge how you use them. Silence is the worst outcome, not a wrong first attempt.
Are puzzles the same as aptitude questions?
They overlap. Aptitude tests have timed questions on numbers, ratios and reasoning with one correct option. Interview puzzles are open-ended and spoken, and the interviewer watches your reasoning. Practising aptitude helps with the arithmetic parts of puzzles.
How should I practise puzzles?
Try each puzzle on paper for ten minutes before reading the answer. Then explain the solution aloud as if to an interviewer. If you can explain why each step is needed, you are ready for variations.
Siva Prasad Galaba
Founder, CodeBegun · Staff Engineer

Founder of CodeBegun. 15+ years building Java systems at companies like Crunchyroll. Teaches Java, Spring Boot and system design the way the industry actually works, and mentors students through projects, mock interviews and placement preparation.

Technically reviewed by CodeBegun Technical TeamLast reviewed 5 December 2026 LinkedIn
Chat with us