Posts

Showing posts from March, 2017

Brain Teasers & Word Problems

1.  Suppose you have ten bags of marbles with ten marbles in each bag. If one bag weighs differentlyn the other bags, and you could only perform a single weighing, how would you figure out which one is different? 2.  You are about to hop on a plane to Seattle and want to know if you should carry an umbrella. You call three friends of yours that live in Seattle and ask each, independently, if it’s raining. 3.  Each of your friends will tell you the truth ⅔ of the time and mess with you by lying ⅓ of the time. If all three friends answer “Yes, it’s raining,” what is the probability that is it actually raining in Seattle? 4.  Imagine you are working with a hospital. Patients arrive at the hospital in a Poisson     Distribution, and the doctors attend to the patients in a Uniform Distribution. Write a function or code block that outputs the patient’s average wait time and a total number of patients that are attended to by doctors on a random day. 5....

Important puzzles for Interview (Remaining will be added soon)

Puzzle 1 | (How to Measure 45 minutes using two identical wires?) How do we measure forty-five minutes using two identical wires, each of which takes an hour to burn. We have matchsticks with us.  The wires burn non-uniformly. So, for example, the two halves of a wire might burn in 10 minute and 50 minutes respectively Solution :         The wires are burning at non-uniform speed, but the time it takes to burn is uniform. The first wire when it is burning from both ends, it will take exactly 30mins to burn completely, but this point of both ends joining will not be the mid point. Meanwhile, the one end which is burning in the second wire would have burnt for 30mins and then when lit from the other end, it will take exactly 15mins to burn completely. So it total, you can measure 30 mins from 1st wire and 15mins from second wire and a total of 45 mins Puzzle 2 | (Find ages of daughters) Alok has three daughters. His friend Shyam wants to...