There were three men in a line (facing forward) so they can only see the man (or men) in front of them. There are also five hats, two black and three white. Each man is wearing one of the hats.
When the man at the back of the line was asked "Do you know your hat color?", he replied "No". When the man that was second in line was then asked "Do you know your hat color?" he replied "No". When the man at the front of the line was asked "Do you know your hat color?" he replied "Of course".
What color of hat was the man at the front of the line wearing?
what gets me is that 2 people have got the puzzle correct and it still says no solution yet , this is a very old puzzle ,it just gets changed around a lot, and in case you didnt know they are all wearing white hats for the very reasons given in the first two comments