Finding Poisonous Pill || Interview Puzzle


Interview logical puzzles are a type of problem or challenge that is designed to test a person's critical thinking, problem-solving, and reasoning skills. These puzzles are commonly used in job interviews for positions that require analytical and problem-solving abilities, such as software development, data analysis, and management roles.

Puzzle Details: There are 8 pills. They are all of the same size and color. One pill weighs slightly more and is poisonous. You have a balanced scale and can only use it twice. How can you find the poisonous pill?

Solution

Split the pills into the following groups, 

Group 1 - 1,2,3 - Group 2 - 4,5,6 - Group 3 - 7,8

For your first weighing, put three pills on one side, and three on the other, leaving two set aside. If one side is heavier, the poison pill is in that group, but if they are the same it's in the two set aside.

If they are the same, then Group 3 contains the poisonous pill. If they are different, the heavier group contains the poisonous pill.

For the second weighing, pick the group the poison pill is in. Put one pill on each side and one off to the side (unless it was in the group of two from before, in which case don't set any aside). If the scale says a side is heavier, that's the side that's got the poison. If you picked a three-pill group and the scales are the same, then the one you didn't weigh out of that group is the poison.

This means if the poison pill in group 3, Balance 7 against 8, The heavier one is the poisonous pill. and if the poison pill is in group 2, Balance one of the pills against another in the same group. If they are the same, then the poisonous pill is the one not weighed. If they are different, the heavier one is the poisonous pill.

Only 2 balances are required to find the poisonous pill.

Watch the below video for a detailed explanation.



You may like these posts:

No comments:

Post a Comment