techInterview
Answers to technical interview questions - accepting donations for dogs

 
home
faq
reading
feedback
discuss
archive
fogcreek
bug tracking
pets in ny
petfinder



*new* techInterview bible


thank your brain
save a dog's life




 

fogcreek programmers  aha:!

100 fogcreek programmers are lined up in a row by an assassin. the assassin puts red and blue hats on them. they can't see their own hats, but they can see the hats of the people in front of them. the assassin starts in the back and says "what color is your hat?" the fogcreek programmer can only answer "red" or "blue." the programmer is killed if he gives the wrong answer; then the assassin moves on to the next programmer. the programmers in front get to hear the answers of the programmers behind them, but not whether they live or die. they can consult and agree on a strategy before being lined up, but after being lined up and having the hats put on, they can't communicate in any way other than those already specified. what strategy should they choose to maximize the number of programmers who are guaranteed to be saved?

solution: fogcreek programmers

 



home | software development | bug tracking software | archive

[general software discussion] [dogs new york city] [Software Quality]