Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding Ninjas X Naukri.com
Table of contents
1.
Introduction
2.
Puzzle Description
3.
Solution
4.
 
5.
Frequently Asked Questions
5.1.
What is a puzzle interview?
5.2.
How do you answer a puzzle in an interview?
5.3.
Why do we do puzzles in interviews?
6.
Conclusion
Last Updated: Mar 27, 2024

Blindfolded Coin Toss

Author Tashmit
0 upvote
Interview Puzzles

Introduction

A puzzle is a magnificent measure of one's analytical skills and lateral thinking. Many product-based companies ask the riddles to help them filter candidates based on their real-world problem-solving skills to approach a problem they have not seen before.

A puzzle may have multiple solutions. The interviewer is generally interested in the candidate's approach to solving the mystery and the approach to building and thinking creatively about the answer to the puzzle.

On the same note, we will discuss an exciting puzzle commonly asked in interviews; Blindfolded coin toss.

Puzzle Description

Assume you are blindfolded and ten coins are kept on a table in front of you. You are permitted to touch and flip the coins but cannot tell heads or tails by touching them. There are five coins with heads up and 5 with tails. Can you build two piles of coins so that the number of heads up is the same in both?

Solution

We can solve this by splitting the coins into an equal number of sets. Now, we will flip the coins of one pile. 

For example:

Pile 1: THTTT

Pile 2: HHHHT

 

Now when we flip Pile 1 coins, 

Pile 1: HTHHH

Pile 2: HHHHT

There is an equal number of heads in both piles.

Illustration Image

 

Check out this problem - Check If A String Is Palindrome

Frequently Asked Questions

What is a puzzle interview?

Microsoft popularized the puzzle interview in the 1990s. Puzzle interviewers ask applicants to solve puzzles to check their analytical thinking skills.

How do you answer a puzzle in an interview?

First of all, think about the problem and carefully understand the question interviewer is trying to ask. Ask for any clarifications, if there are any. Lastly, don't just tell the answer, but clearly explain the solution.

Why do we do puzzles in interviews?

Puzzles are generally asked to see how you go about solving tricky problems. 

Conclusion

This article extensively discussed Blindfolded Coin Toss and provided its solution. 

Recommended Readings:


Do check out The Interview guide for Product Based Companies as well as some of the Popular Interview Problems from Top companies like Amazon, Adobe, Google, etc. on Coding Ninjas Studio.

Also check out some of the Guided Paths on topics such as Interview Puzzles, Data Structure and Algorithms, Competitive Programming, Operating Systems, Computer Networks, DBMS, System Design, etc. as well as some Contests, Test Series, Interview Bundles, and some Interview Experiences curated by top Industry Experts only on Coding Ninjas Studio.

Live masterclass