Quant, Math & Computer Science Puzzles for Interview Preparation & Brain Teasing
A collection of ~225 Puzzles with Solutions (classified by difficulty and topic)

Feb 21, 2013

Mad Hat Party

Source: Australian Mathematical Society Gazette - Puzzle Corner 28

Problem: 
The Mad Hatter is holding a hat party, where every
guest must bring his or her own hat. At the party, 
whenever two guests greet each other, they have to 
swap their hats. In order to save time, each pair of 
guests is only allowed to greet each other at most 
once.



After a plethora of greetings, the Mad Hatter notices that it is no longer possible
to return all hats to their respective owners through more greetings. To sensibly 
resolve this maddening conundrum, he decides to bring in even more hat wearing 
guests, to allow for even more greetings and hat swappings. How many extra guests 
are needed to return all hats (including the extra ones) to their rightful owners?


Other "Hat" Problems on the blog:

Feb 5, 2013

Broken Clock Puzzle

Source: http://www.ocf.berkeley.edu/~wwu/riddles/medium.shtml



Problem:
My fancy new digital alarm clock is broken! The time 'jumps' around.

When I reset it, it reads 12:00:00. Then it runs as it should, but after 12:04:15 it resets back to 12:00:00. It counts up to 12:04:15 again and then it jumps to ... 12:08:32 ! Weird stuff.

Do you know what's wrong with my alarm clock?

Update (12/02/2013)
Solution posted by Saumya Gupta, Abhimanyu Dhamija (CSE IITB 2011 Alumnus, Citibank Analyst) and Naga Vamsi Krishna in comments!


Feb 3, 2013

Probability Puzzle: Guess Position of Card

Source: Counter-intuitive Conundrums


Problem:
Someone hands you a deck of cards which you thoroughly shuffle. Next, you start to deal them, face-up, counting the cards as you go. “One, Two, Three …”

The aim is to predict what the count will be when you encounter the second black Ace in the deck.

If you had to select one position before you started to deal, what number would you select that maximizes your chance of guessing the location of the second black Ace?