Interview Puzzles Set 12 – Open Doors | The Poisoned Wine

Logic is in the eye of the Logician.

– Gloria Steinem

Algorithmic thinking is really important as it enhances your thinking skills and can be nurtured with practice. (Refer the previous tutorial to know more about Algorithmic Thinking and try the puzzles before moving on to the solutions.)

 Solutions for the previous problems

Puzzle 11.1 Solution – Maximum Distance Travelled

Correct Answer:  25000 miles

Explanation: Since there are five tires in total and only four are needed at a particular time, therefore the four tires need to be replaced with the spare tire in turns, so divide the lifetime of each tire into four stages(20000/4 = 5000 miles).

In the first stage(0-5000 miles), the first tire will be replaced by the spare tire.

In the second stage(5000-10000 miles), we will replace the second tire with the spare tire and use all tires except the second tire; similarly the third and the fourth stage will involve using all tires except third and fourth tire respectively.

The car would have traveled 20000 miles and the spare tire would also have covered 20000(5000 x 4) miles where as all other tires(4) would have covered just 15000 miles since we left one tire out in each stage. Therefore the car will run 1 more stage of 5000 miles without the spare tire. Thus the total distance covered by the car is 25000 miles.

Puzzle 11.2 Solution – The Fake Note

Correct Answer:  The first shopkeeper lost Rs.2000

Explanation: In this case, total profit earned is equal to the total loss incurred and only the lady earned the profit (Rs.500 item + Rs.1500 cash back=Rs.2000) where as only the first shopkeeper incurred loss.

The second shopkeeper didn’t gain any profit or incur any loss because he got his money back. The loss of the first shopkeeper is equal to the gain of the lady i.e Rs.2000.

Puzzle 11.3 Solution – Colliding Ants

Correct Answer:  Probability is 3/4.

Explanation: Each ant can move in only 2 directions i.e. either clockwise or anti-clockwise direction. So total possibilities will be (2 x 2 x 2=) 8. The ants will not collide only when all are moving in only clockwise or anti-clockwise direction i.e. 2 possibilities. The probability that ants will not collide will be 2/8 = 1/4. Therefore the probability that the ants will collide will be 1-(1/4)=3/4 

Solving these puzzles is fun, isn’t it? So, wear your logic caps and get ready for your next brain workout:

Algorithmic Thinking
Algorithmic Thinking

Quiz 12.1  – Open Doors

There are 100 doors in a long hall which are initially closed. There are 100 people who walk through the hall and open the door if it was closed and close the door if it was open but each person will do this only to the door number of their multiples.

For ex. the 1st person will change the state of each door, the second one will change the state of every 2nd door (i.e doors 2,4,6,….100), the third one will change the state of every 3rd door (i.e. doors 3,6,9….99) and so on.

How many doors will be open in the end?

Just think about it and post your answer in the comments. I’ll explain this in the next tutorial.

Solution Added – Solution of “Open Doors” puzzle

Quiz 12.2 – The Poisoned Wine

There are 1000 wine bottles including a poisoned wine bottle. All the bottles are exactly identical. We know that a rat will die in 1 hour after drinking the poisoned wine. What is the minimum number of rats needed to find out exactly which bottle contains poison in 1 hour? 

Just think about it and post your answer in the comments.

Solution Added – Solution of “The Poisoned Wine” puzzle

So start thinking and comment answer to the questions asked above and wait for the next post for the solutions.
Do Share and Subscribe and comment your opinion, queries and suggestions.
Keep Learning. Happy Learning 🙂