Google Job Interview Brainteaser Leaves People Stumped
Google Job Interview Brainteaser Leaves People Stumped

TikTok creator Tanya Zakowich, known as @pinkpencilmath, has revealed that Google used to ask job applicants a prisoner hat brainteaser and would not hire anyone who could not solve it.

In a video, she said: "If you don't know the prisoner hat riddle, you're going to love this one. It's a super classic brainteaser that was commonly asked in job interviews at Google."

The riddle

Zakowich explains that four prisoners are on a staircase, all facing the same direction. A brick wall separates prisoner 4 from the rest. Prisoner 1 can see prisoners 2 and 3, prisoner 2 can only see prisoner 3, while prisoners 3 and 4 cannot see anyone.

Wide Pickt banner — collaborative shopping lists app for Telegram, phone mockup with grocery list

All four wear hats and are told there are only two black hats and two white hats, but they do not know the colour of their own hat. They are told to shout out the colour of their hat as soon as they know it.

The prisoners are not allowed to turn around, change their formation or remove their own hats.

The answer

According to Puzzles and Riddles, the correct answer is prisoner two, referred to as B in its explanation. A statement from the site 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!"

Viewers weigh in

Commenters on the video offered similar reasoning. One user wrote: "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 user suggested prisoner four, saying "he knew no one was looking at him so he took his hat off to look," while another said they used to give the riddle to their math students.

Background

In 2013, Google is believed to have toned down such brainteasers. The former head of Google human resources told the New York Times that the questions couldn't "predict anything" and were mainly there to "make the interviewer feel smart."

Pickt after-article banner — collaborative shopping lists app with family illustration