Tanya Zakowich, who posts on TikTok as @pinkpencilmath, said Google used to present the prisoner hat riddle to job candidates and would not hire anyone who failed it.
However, the company reportedly scaled back these questions in 2013, with the former chief of Google human resources telling the New York Times that they could not "predict anything" and were mainly there to "make the interviewer feel smart."
The riddle
In her video, Zakowich said: "If you don't know the prisoner hat riddle, you're going to love this one." She described it as a "super classic brainteaser that was commonly asked in job interviews at Google."
The scenario involves four prisoners lined up on a staircase, all facing the same direction. A brick wall separates prisoner 4 from the other three. Prisoner 1 can see prisoners 2 and 3, prisoner 2 can only see prisoner 3, and prisoners 3 and 4 cannot see anyone. Each prisoner wears a hat, and they are told there are two black hats and two white hats. They do not know the colour of their own hat. Their task is to shout out the colour as soon as they know it. The question is who shouts out first and why. The prisoners cannot turn around, move, or remove their hats.
What viewers said
Viewers weighed in with their reasoning. One commented: "Prisoner two. If both prisoner two and three were wearing the same hat, one would have known that he was wearing the other hat. But since he didn't, two knows that." Another said: "Two as he can use one's silence to infer that two and three have different colour hats. Since two can see three then two must be the opposite colour of three." A third offered a cheeky answer: "Four because he knew no one was looking at him so he took his hat off to look." And a fourth added: "I used to give this riddle to my math students all the time. It's two because one didn't say anything so they know they're different from three."
The official answer
According to Puzzles and Riddles, the correct answer is prisoner two, referred to as B in their explanation. The statement reads: "If prisoners B and C had the same colour hat on, prisoner A would have know immediately that his hat was the other colour (there are only two hats of each colour). Since prisoner A was silent, prisoners B and C must have different coloured hats. Prisoner B realised this and knew that his hat was not the same colour as prisoner C, therefore his hat must be black!"
More challenges
The article also points to other visual puzzles. One previously claimed that only 2% of people can spot all four hidden women in a sketch by Ukrainian artist Oleg Shupliak. Another optical illusion sparked debate over hidden numbers in a circle filled with swirling black patterns.



