# Interview Puzzles Set 15 – Matching Socks | Finding The Prankster

Logic is neither an art nor a science but a dodge.

-Slendhal

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

### Solutions for the previous problems

#### Puzzle 14.1 Solution – The Ill Pill

Explanation: Since the pills are really expensive, the man can’t throw away the mixture, so the only option is to use the mixture. But he can’t use it directly as the mixture is not right and it would be harmful to his health. So, if we add another blue pill in the mixture and divide the mixture into two equal halves, the composition of both the halves will have a green and a blue pill and the man can drink one-half on the same day and the other half on the next day. That would solve the problem without having to throw the mixture.

#### Puzzle 14.2 Solution – Siblings

Correct Answer:  4 Girls and 3 Boys

Explanation:

Since each sister has as many sisters as brothers, the number of girls must be one more than the number of boys.

Each one of the boys has twice the number of sisters as brothers, therefore the number of girls must be one more than twice the number of boys.

Combining both these conclusions, the only possible solution is – there are 4 Girls and 3 Boys in the family.

Another Solution is 2 Girls and 1 Boy.

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

### Quiz 15.1  – Matching Socks

You were getting ready for a party but suddenly there was a power failure. You don’t have any source of light nearby and you still have to wear socks. You are not able to distinguish between different colors in the dark, but you are getting late for the party. You know that you have 20 black socks, 10 purple socks and 6 white socks.

What is the minimum number of socks that you need to take out of the drawer to be sure that you have a matching pair?

### Quiz 15.2 – Finding The Prankster

One of your four friends, Vasu, Shreya, Arjun and Ram played a prank on you but you don’t know who did it. When you asked them about it, their response was as follows

Vasu: Shreya did it.

Shreya: Vasu did it.

Arjun: Vasu is telling is the truth.

Ram: Arjun is not lying.

You know that only one of them is telling the truth and others are lying. So, who actually played the prank on you?