# Interview Questions

Ritambhara Technologies - Coding Interview Preparations > Interview Questions > Logic > Puzzles > Honest man playing card puzzle

# Honest man playing card puzzle

- December 12, 2012
- Posted by: Kamal Rawat
- Category: Puzzles

An honest man holds a card which can be either ‘1‘, ‘2‘ or ‘3‘.

You can ask one (and only one) question to the man. The man is allowed to answer only ‘Yes‘, ‘No‘ and ‘I don’t know‘. The honest man obviously never lies.

What question will you ask so that you get to know about the card with 100% certainty?

**Solution:**

The question should be such that the man has to give different answer for each of the three value (so that we can identify the card he is holding).

*If I subtract 2 from your number, and then take square root, would the result be greater than zero?*

**If man has 3**. Sqrt(3-2) = 1. 1 IS GREATER THAN 0. Hence man will say ‘YES‘.**If man has 2**. Sqrt(2-2) = 0. 0 IS NOT GREATER THAN 0. Hence man will say ‘NO‘.**If man has 1**. Sqrt(1-2) = Undefined (Square root of negative is not defined). Hence man will say ‘I DON’T KNOW‘.

Note: *You should not expect such puzzles in any product based company.*

I will ask,”the card in ur hand is smaller than 2?”…

If he says yes then its 1,if no then its 3 ,if anythng else then obviously its 2…

Its just a problem of mapping {1, 2, 3} to {Yes, No, Don’t know}. Can’t this be done in much simpler ways?

My first answer would be “If you have 1, say yes, if 2, no, else, don’t know”.

Second, “Is the number on your card lesser than 2?”