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

Feb 25, 2012

Maxima Property Subset

Source: Asked to me by Santosh Ananthakrishnan (EE IITB Fifth year undergraduate, To be Worldquant Analyst)

At most, how many subsets can you find of the set A = {1, 2, ..., n} such that any two intersect in exactly one element?

Feb 16, 2012

Lion in a Circular Cage Puzzle

Asked to me by Pramod Ganapathi (PhD Student at Stony Brook University)

A lion and a lion tamer are enclosed within a circular cage. If they move at the same speed but are both restricted by the cage, can the lion catch the lion tamer? (Represent the cage by a circle, and the lion and lion tamer as two point masses within it.)

Feb 8, 2012

Algorithm Puzzle: Triplets in Array

Source: Asked to me by Anuj Jain (EE IITB 2010 Graduate, MFE Student at Baruch College NY)

Given an array of n integers, find an algorithm to find triplets in the array such that sum of the three numbers is zero.

What is the order of your algorithm? Make sure its quadratic in size of array. :-)

Feb 6, 2012

Original Problem : ATM Money Withdrawal Puzzle

Source: One of the very few original problems on the blog. Remember 'Mathematics of Housie'? Please share if you like!

a) I have infinite money in my account
b) The daily limit of amount of money that can be withdrawn from an ATM is finite
c) You can login into an ATM Machine only once a day
d) If you login into the machine and enter a large number to withdraw, you will not get anything. And hence, you will not be able to withdraw anything from the ATM for the day.
e) I do not know what the daily limit is.

What strategy should I choose so that I can withdraw N rupees in minimum number of days?

Of course, you can do it in N days (withdrawing only one rupee daily)
you could do it in N-limit + ceiling(N/limit)-1 days (check N, check N-1, .. check limit. Once you know the limit, and you have already withdrawn 'limit' rupees, you will take ceiling ((N-limit)/limit) days more.

Can you do better?

Update: (19-07-2012)
This is essentially an open ended question, until of course we get the proof that a solution is optimal.