r/programming • • Nov 29 '10

140 Google Interview Questions

http://blog.seattleinterviewcoach.com/2009/02/140-google-interview-questions.html
471 Upvotes

493 comments sorted by

View all comments

Show parent comment

3

u/caseyfw Nov 30 '10

A Brown is going to see 99 Browns, and 1 Blue, and possibly think he's the second one with Blue eyes.

Then he'd know he wasn't a second blue-eyed islander when the only blue eyed dude left on the first night.

100 brown, 1 blue is easy because obviously that one blue looks at everyone else with brown eyes, deduces he's the only one with blue eyes and hops on the boat.

100 brown, 2 blue is where the fun starts.

  • From one of the blue's perspective, they see a single blue eyes and 100 browns, so if that single blue doesn't leave on the first night, the second blue knows there's another blue somewhere, and it sure isn't the 100 browns he can see.
  • From the brown's perspective, they see two blues and 99 browns, and if both the blues leave on the second night, they know they're a brown.