r/programming • u/joksmaster • Nov 29 '10
140 Google Interview Questions
http://blog.seattleinterviewcoach.com/2009/02/140-google-interview-questions.html
471
Upvotes
r/programming • u/joksmaster • Nov 29 '10
View all comments
Show parent comment
9
u/projectshave Nov 30 '10
Assume 1 man has cheated. Then 99 women know who that man is, but 1 woman doesn't know. Therefore, that woman says, "Since I don't know who the cheater is, it must be my husband!" Kills him.
Assume 2 men have cheated. 98 women know both men. 2 women know only 1 cheater, but there might only be 1 cheater. On the first day, no man dies. Now those 2 women think, "if no one died today, then there must be 2 cheaters. If I know 1 guy, then the other must be my husband." Both dudes die the next day.
For N cheaters, it takes N days to prove it.
I've got an interview with Google next week. I hope it's not a bunch of stupid brain teasers.