Got asked this in an interview, almost crapped my pants:
There are three men sitting in a row looking forward, each man can only see in-front of them and cannot see what is on their heads.
A box has three red hats in it and two blue hats, these hats are put on the men at random.
The man in the back is asked if he knows what color hat he is wearing, from observation of the men in front of him, he says no.
The man in the middle is asked if he knows what color hat he is wearing, from observation of the man in front of him, he says no.
The man in the front is asked if he knows what color hat he is wearing, from inference, he says yes.
What color hat is he wearing and how does he know?