Suppose you have a random number generator that generates a number uniformly between a and b. However, you do not know a and b. How do you generate a random number uniformly distributed between 0 and 1? You are only allowed a finite number of copies of Unif(a,b) random variables. - via Tom Courtade.
Monthly Archives for November, 2013
Measure 9 minutes using a 7 minute and a 4 minute sand-timer. -via old Google Interview Questions (Google stopped asking such brainteasers and riddles in interviews; now they only ask coding questions).
Suppose a function f(x) satisfies for all real x, where n is a natural number. Then show that . - via Sudeep
You are given a cuboid in 3-D space, defined by the end-points of the diagonal (x1,y1,z1) and (x2,y2,z2) where x1<x2,y1<y2,z1<z2. You are also given the center (x3,y3,z3) of a circle and it's radius r. How will you test if the cuboid and the circle intersect? We want an elegant solution. - Via Cheuk Ting Li.
Suppose you are shrunk into the size of a nickel and placed inside a blender. Your shape and density remains unchanged. The blender's lid is open. In 60 seconds, the lid will close, and the blender will start. If you don't get out of the blender by then, you are doomed. Show how you will get out of the blender. Hint: This is a physics problem, … Continue reading the story "Escape from Blender:"
A helium balloon is tied to a string inside a car. You secure the other end of the string to a point in the car. All windows in the car are closed. Now the car starts accelerating forward. Will the Helium balloon move forward, or move backwards or stay put? - via Google Interview questions available publicly on wired magazine
It takes 6 days to cross the desert. However, you can only carry food and water supplies for 4 days. You are allowed to hire as many helpers as you can. Each helper can only carry food and water for 4 days and each helper has to eat and drink himself too. How will you cross the desert? None of your helpers should die in … Continue reading the story "Crossing the desert"
If 12 oxen eat up 3 and 1/3 acres of grass in 4 weeks, and 21 oxen eat up 10 acres in 9 weeks, how many oxen will eat up 24 acres in 18 weeks; the grass being at first equal in every acre, and growing uniformly? Note: If you have not yet tried to solve this problem, do try, particularly in the 19th-century arithmetical … Continue reading the story "Pasturage problem"
If you travel in a cable car from one end to another, what fraction of the cars do you pass on the other side? - via Programming interviews exposed
You go 1 mile south, then 1 mile east and finally 1 mile to the north. You come back to where you started. One way to achieve this is starting from the north pole. But there are other ways to achieve this. Can you find 3 other ways to achieve this feat of coming back to the starting point after executing the stated moves? - via … Continue reading the story "Come back to where you started"