Interview Prep
Interview Puzzles — 15 Brain Teasers with Step-by-Step Solutions for Tech and Consulting Interviews
Interview puzzles (brain teasers) are asked at product companies like Google and Amazon, consulting firms like McKinsey and BCG, and Indian product companies like Flipkart and Razorpay. They test how you think, not what you know. Here are 15 puzzles with complete solutions.

The interviewer cares more about your thought process than the final answer.
Why Puzzles in Interviews
Brain teasers and puzzles show up in interviews at Google, Amazon, Goldman Sachs, McKinsey, and Indian product companies like Flipkart, Swiggy, and Razorpay. Consulting firms use them in case interviews. Banks use them for quant roles. Even some service companies have started including them for senior positions.
The puzzles in this guide are organized into three categories: logic puzzles (pure reasoning), estimation/Fermi puzzles (structured guessing), and math/probability puzzles (quantitative thinking). Each comes with a complete solution and what the interviewer is actually evaluating.
Remember the golden rule: the process matters more than the answer. An interviewer would rather hear a structured wrong approach than a lucky right answer with no explanation.
Companies do not ask puzzles to see if you are smart. They ask puzzles to see how you think when you do not immediately know the answer.
Why They Ask Them
What Puzzles Actually Test
What interviewers evaluate when asking puzzles: 1. Structured thinking → Can you break a complex problem into parts? 2. Communication under pressure → Can you think out loud clearly? 3. Comfort with ambiguity → How do you react when there is no obvious path? 4. Creativity → Can you see non-obvious approaches? 5. Intellectual curiosity → Do you enjoy the problem or just endure it? What they do NOT test: ✗ Prior knowledge of the puzzle ✗ Speed of getting the answer ✗ Mathematical genius The interviewer wants to see HOW you think, not IF you get the right answer.
Where Puzzles Are Asked
Product companies: Google, Amazon, Microsoft, Flipkart, Razorpay, Swiggy — especially for SDE and PM roles.
Consulting firms: McKinsey, BCG, Bain, Deloitte — as part of case interviews or standalone rounds.
Finance: Goldman Sachs, JP Morgan, quant funds — for trading and quant roles.
Indian companies: Some service companies like TCS and Infosys include them for lateral hiring. Startups use them for senior roles.
Logic Puzzles
Puzzle 1: The Two Doors Riddle
You are in a room with two doors. One leads to freedom, the other to death. There are two guards — one always tells the truth, one always lies. You can ask ONE question to ONE guard. What do you ask?
Solution: Ask either guard: "If I asked the OTHER guard which door leads to freedom, what would they say?" Then choose the OPPOSITE door. Why this works: - If you ask the truth-teller: He truthfully reports the liar's answer (wrong door) - If you ask the liar: He lies about the truth-teller's answer (wrong door) Either way, you get the WRONG door pointed out. So you pick the other one. What the interviewer evaluates: → Can you use meta-reasoning (question about a question)? → Can you verify your logic covers both cases?
Puzzle 2: The Light Bulb Problem
You are outside a room with 3 light switches. Inside the room is a single light bulb. You can flip switches as many times as you want, but you can only enter the room ONCE. How do you determine which switch controls the bulb?
Solution: 1. Turn switch 1 ON for 10 minutes 2. Turn switch 1 OFF 3. Turn switch 2 ON 4. Enter the room If bulb is ON → Switch 2 If bulb is OFF but WARM → Switch 1 If bulb is OFF and COLD → Switch 3 Key insight: Use HEAT as a second data point. Most people only think about on/off (1 bit). Temperature gives you a second bit of information. What the interviewer evaluates: → Can you think beyond the obvious binary state? → Do you consider physical properties, not just logic?
Puzzle 3: The Poisoned Wine
You have 1000 bottles of wine. Exactly one is poisoned. You have 10 prisoners to test with. Poison takes exactly 24 hours to kill. You have exactly 24 hours. How do you find the poisoned bottle?
Solution: Binary encoding Number each bottle 1-1000 in binary (10 bits). Each prisoner represents one bit position. Bottle 1 = 0000000001 → only prisoner 1 drinks Bottle 2 = 0000000010 → only prisoner 2 drinks Bottle 3 = 0000000011 → prisoners 1 and 2 drink ... Bottle 1000 = 1111101000 → prisoners 4,6,7,8,9,10 After 24 hours, the pattern of dead prisoners gives you the binary number of the poisoned bottle. Example: if prisoners 3 and 7 die → binary 0001000100 = bottle 68 Why 10 prisoners is enough: 2^10 = 1024 > 1000 What the interviewer evaluates: → Do you know binary encoding? → Can you map abstract CS concepts to real problems?
Puzzle 4: The Burning Rope Timer
You have two ropes. Each takes exactly 60 minutes to burn completely. But they burn unevenly (some parts burn faster). How do you measure exactly 45 minutes?
Solution: At time 0: - Light Rope 1 from BOTH ends - Light Rope 2 from ONE end At time 30 minutes: - Rope 1 is completely burned (60/2 = 30 min) - Rope 2 has 30 minutes of burn left When Rope 1 finishes (30 min mark): - Light Rope 2 from the OTHER end too Rope 2 now burns from both ends. It had 30 minutes left → now takes 15 minutes. Total: 30 + 15 = 45 minutes ✓ Key insight: Lighting from both ends halves the time, regardless of uneven burning. What the interviewer evaluates: → Can you combine two simple ideas creatively? → Do you handle the "uneven burning" constraint?
Puzzle 5: The River Crossing
A farmer needs to cross a river with a fox, a chicken, and a bag of grain. The boat holds only the farmer and one item. If left alone: the fox eats the chicken, the chicken eats the grain. How does the farmer get everything across?
Solution (7 trips):
Trip 1: Farmer takes CHICKEN across →
(fox + grain safe together)
Trip 2: Farmer returns alone ←
Trip 3: Farmer takes FOX across →
Trip 4: Farmer brings CHICKEN back ←
(key insight: bring something BACK)
Trip 5: Farmer takes GRAIN across →
(fox + grain safe, chicken on other side)
Trip 6: Farmer returns alone ←
Trip 7: Farmer takes CHICKEN across →
All safe on the other side ✓
The trick: most people do not consider bringing
an item BACK. The chicken acts as a "swap."
What the interviewer evaluates:
→ Can you think about state management?
→ Do you consider non-obvious moves (going backward)?Estimation / Fermi Puzzles
Puzzle 6: How Many Tennis Balls Fit in This Room?
Structured approach: Step 1: Estimate room dimensions → Typical interview room: 4m x 5m x 3m → Volume = 60 cubic meters = 60,000,000 cm³ Step 2: Estimate tennis ball size → Diameter ≈ 6.7 cm, radius ≈ 3.35 cm → Volume of one ball ≈ (4/3)π(3.35)³ ≈ 157 cm³ Step 3: Account for packing efficiency → Random packing ≈ 64% efficiency → Usable volume = 60,000,000 × 0.64 = 38,400,000 cm³ Step 4: Calculate → 38,400,000 / 157 ≈ 244,586 balls → Round to ~250,000 tennis balls State your assumptions clearly. The exact number does not matter — the structure does.
Puzzle 7: How Many Petrol Pumps in India?
Structured approach: Step 1: India's population → ~1.4 billion Step 2: Vehicles per person → ~1 vehicle per 5 people = 280 million vehicles → Mix of 2-wheelers (70%), cars (25%), commercial (5%) Step 3: Fuel consumption per vehicle per month → Average: ~50-80 liters/month across types Step 4: How much can one pump sell? → Average pump sells ~100,000-150,000 liters/month Step 5: Total fuel demand / per-pump capacity → ~280M vehicles × 60L avg = 16.8 billion liters/month → 16.8B / 125,000 = ~134,000 pumps Actual number: ~84,000 (as of 2024) Being within 2x is considered a good Fermi estimate. Key: Show your reasoning chain, not just a guess.
Puzzle 8: How Many WhatsApp Messages Are Sent Daily in India?
Structured approach: Step 1: WhatsApp users in India → ~500 million Step 2: Daily active users → ~70% = 350 million Step 3: Segment users by activity: → Heavy users (20%): 100+ messages/day → Medium users (40%): 30-50 messages/day → Light users (40%): 5-10 messages/day Step 4: Calculate weighted average → 70M × 100 = 7 billion → 140M × 40 = 5.6 billion → 140M × 7 = 980 million → Total ≈ 13.6 billion messages/day Step 5: Add group messages (multiplier effect) → Groups amplify by ~1.5x → ~20 billion messages/day This is an India-specific question — show you understand Indian digital behavior.
Puzzle 9: How Much Does a Boeing 747 Weigh?
Structured approach:
Step 1: Think about components
→ Fuselage (aluminum/composite body)
→ Wings and engines
→ Fuel
→ Passengers and cargo
Step 2: Estimate each
→ Empty aircraft structure: think of it as a
large aluminum tube, 70m long, 6m diameter
→ Engines: 4 engines, each ~5,000 kg = 20,000 kg
→ Fuel capacity: ~200,000 liters of jet fuel
(density ~0.8 kg/L) = 160,000 kg
→ Passengers: ~400 people × 80 kg = 32,000 kg
→ Cargo and equipment: ~20,000 kg
Step 3: Empty weight estimate
→ Structure + systems ≈ 180,000 kg
Step 4: Maximum takeoff weight
→ 180,000 + 160,000 + 32,000 + 20,000
→ ≈ 392,000 kg ≈ 400,000 kg (400 tonnes)
Actual: ~412,000 kg (max takeoff weight)
Excellent estimate!Puzzle 10: How Many Piano Tuners in Mumbai?
Structured approach (classic Fermi question): Step 1: Mumbai population → ~21 million Step 2: How many pianos in Mumbai? → Pianos are rare in India compared to the West → Hotels with pianos: ~200 hotels × 1 = 200 → Music schools/churches: ~300 → Wealthy homes: ~5,000 (very rough) → Recording studios/venues: ~100 → Total: ~5,600 pianos Step 3: How often is a piano tuned? → Professional pianos: 2-4 times/year → Home pianos: 1-2 times/year → Average: 2 times/year → Total tunings: 5,600 × 2 = 11,200/year Step 4: How many tunings can one tuner do? → 4 tunings/day × 250 working days = 1,000/year Step 5: Tuners needed → 11,200 / 1,000 ≈ 11 piano tuners This is a tiny number — which makes sense for Mumbai where pianos are not common instruments.

Estimation puzzles test your ability to structure the unknown — a skill every consultant and PM needs.
Math / Probability Puzzles
Puzzle 11: The Monty Hall Problem
You are on a game show. There are 3 doors. Behind one is a car, behind the other two are goats. You pick door 1. The host (who knows what is behind each door) opens door 3, revealing a goat. Should you switch to door 2?
Solution: YES, always switch. Probability if you STAY: 1/3 (your initial pick) Probability if you SWITCH: 2/3 Why? Your initial pick has 1/3 chance of being right. That means there is a 2/3 chance the car is behind one of the other two doors. When the host opens a goat door, all that 2/3 probability concentrates on the remaining door. Think of it with 100 doors: - You pick door 1 (1% chance) - Host opens 98 doors showing goats - Would you switch to the one remaining door? Of course! It has 99% probability. Common mistake: thinking it is 50/50 after the reveal. The host's action gives you NEW information.
Puzzle 12: The Birthday Paradox
How many people do you need in a room for there to be a greater than 50% chance that two people share a birthday?
Solution: Only 23 people. This is counterintuitive because we think about the chance of someone sharing OUR birthday (1/365). But the question is about ANY two people matching. With 23 people, there are C(23,2) = 253 pairs. Each pair has a 1/365 chance of matching. 253 pairs × (1/365) ≈ 69% (rough estimate) Exact calculation (complement method): P(no match) = 365/365 × 364/365 × 363/365 × ... For 23 people: P(no match) ≈ 0.493 P(at least one match) = 1 - 0.493 = 0.507 > 50% ✓ At 50 people: probability rises to 97% At 70 people: 99.9% Key insight: combinatorial explosion of pairs grows much faster than linear addition of people.
Puzzle 13: Coin Flip Probability
You flip a fair coin repeatedly. What is the expected number of flips to get two heads in a row?
Solution: 6 flips (expected value) Let E = expected flips to get HH State analysis: - Start state (S): need 2 heads - State H: got 1 head, need 1 more - State HH: done! From S: Flip H (prob 1/2) → go to state H Flip T (prob 1/2) → stay in S E_S = 1 + (1/2)E_H + (1/2)E_S From H: Flip H (prob 1/2) → done! (0 more needed) Flip T (prob 1/2) → back to S E_H = 1 + (1/2)(0) + (1/2)E_S Solving: E_H = 1 + (1/2)E_S E_S = 1 + (1/2)(1 + (1/2)E_S) + (1/2)E_S E_S = 1 + 1/2 + (1/4)E_S + (1/2)E_S E_S = 3/2 + (3/4)E_S (1/4)E_S = 3/2 E_S = 6 Expected flips = 6
Puzzle 14: The 100 Prisoners Problem
100 prisoners are numbered 1-100. 100 boxes contain slips numbered 1-100 (randomly). Each prisoner can open 50 boxes. If ALL prisoners find their own number, they are freed. They can strategize beforehand but cannot communicate during. What strategy gives them the best chance?
Solution: Follow the cycle strategy (~31% success) Strategy: 1. Prisoner #k starts by opening box #k 2. If box #k contains number m, open box #m next 3. Follow this chain until you find your number 4. Stop after 50 boxes Why this works: The random arrangement creates permutation cycles. If no cycle is longer than 50, ALL prisoners succeed. P(longest cycle ≤ 50) ≈ 1 - ln(2) ≈ 0.3069 ≈ 31% Random guessing: (1/2)^100 ≈ 0.0000...0008 Cycle strategy: ~31% This is astronomically better than random! Key insight: by following cycles, prisoners' fates become correlated (all succeed or all fail together) instead of independent.
Puzzle 15: Expected Value of a Dice Game
You roll a fair 6-sided die. You can either take the value shown (in rupees) or pay Rs 1 to re-roll. What is the optimal strategy and expected value?
Solution: Let E = expected value with optimal strategy. If you roll and get value v: Keep if v ≥ E (the value beats re-rolling) Re-roll if v < E (pay Rs 1 for another chance) Start with guess: E ≈ 4 Keep: 4, 5, 6 (probability 3/6 = 1/2) Re-roll: 1, 2, 3 (probability 1/2) E = (1/2) × average(4,5,6) + (1/2) × (E - 1) E = (1/2)(5) + (1/2)(E - 1) E = 2.5 + E/2 - 0.5 E = 2 + E/2 E/2 = 2 E = 4 Verify: keep 4,5,6 → average kept = 5 E = (1/2)(5) + (1/2)(4-1) = 2.5 + 1.5 = 4 ✓ Optimal strategy: keep 4, 5, or 6. Re-roll 1, 2, 3. Expected value: Rs 4 per game.
How to Approach Any Puzzle
The 5-Step Framework for Any Interview Puzzle
Step 1-2: Understand
- • Repeat the problem back
- • Ask clarifying questions
- • State your assumptions
- • Identify constraints
- • Draw a diagram if helpful
Step 3-4: Solve
- • Think out loud — always
- • Break into smaller parts
- • Try simple cases first
- • Look for patterns
- • Consider edge cases
Step 5: Verify
- • Check with a small example
- • Sanity check the answer
- • Acknowledge if unsure
- • Discuss alternative approaches
- • It is okay to not finish
What to Do When You Are Stuck
Getting stuck is expected. The interviewer is watching how you handle it. Say “Let me think about this differently” and try a new angle. Ask if you can simplify the problem (fewer items, smaller numbers). Try working backward from the answer. Draw it out on paper.
The worst thing you can do is go silent. Keep talking through your thought process. Even a wrong approach, clearly communicated, scores better than silence. Remember: the process matters more than the answer.