Puzzles



Page 3 of 11«12345»...Last »

A tank can be filled by pipe A in 30 minutes and by pipe B in 24 minutes. Outlet pipe C can empty the full tank in X minutes. If the tank is empty initially and if all the three pipes A, B and C are opened simultaneously, the tank will NEVER be full. Give the maximal possible

View the Answer

Besides communication cost, what is the other source of inefficiency in RPC? How can you optimize the communication?

View the Answer

In a Xs and 0s game (i.e. TIC TAC TOE) if you write a program for this give a fast way to generate the moves by the computer. I mean this should be the fastest way possible.

View the Answer

Give a very good method to count the number of ones in a “n” (e.g. 32) bit number.

View the Answer

You have 5 jars of pills. Each pill weighs 10 gram, except for contaminated pills contained in one jar, where each pill weighs 9 gm. Given a scale, how could you tell which jar had the contaminated pills in just one measurement?

View the Answer

Given a rectangular (cuboidal for the puritans) cake with a rectangular piece removed (any size or orientation), how would you cut the remainder of the cake into two equal halves with one straight cut of a knife?

View the Answer

Classic: If a bear walks one mile south, turns left and walks one mile to the east and then turns left again and walks one mile north and arrives at its original position, what is the color of the bear.

View the Answer

it’s OK to post these (properly tagged as ‘puzzle’s of course), knowing that it’s not a ‘real question’ in the sense that the one who asks (usually) knows the answer?

View the Answer

Can you overload a function according to the return value? Define a function that returns different things according to how the return value is used

View the Answer

You are given a 32-bit unsigned integer array with length up to 232, with the property that more than half of the entries in the array are equal to N, for some 32-bit unsigned integer N. Find N looking at each number in the array only once and using at most 2 kB of memory.

View the Answer

A helicopter drops two trains, each on a parachute, onto a straight infinite railway line. There is an undefined distance between the two trains. Each faces the same direction, and upon landing, the parachute attached to each train falls to the ground next to the train and detaches. Each train has a microchip that controls its motion. The chips are identical. There is no way for the trains to know where they are. You need to write the code in the chip to make the trains bump into each other. Each line of code takes a single clock cycle to execute.

View the Answer

There are four dogs/ants/people at four corners of a square of unit distance. At the same instant all of them start running with unit speed towards the person on their clockwise direction and will always run towards that target. How long does it take for them to meet and where?

View the Answer

You have 5 jars of pills. Each pill weighs 10 gram, except for contaminated pills contained in one jar, where each pill weighs 9 gm. Given a scale, how could you tell which jar had the contaminated pills in just one measurement?

View the Answer

You have a bucket of jelly beans. Some are red, some are blue, and some green. With your eyes closed, pick out 2 of a like color. How many do you have to grab to be sure you have 2 of the same?

View the Answer

If you had an infinite supply of water and a 5 quart and 3 quart pail, how would you measure exactly 4 quarts?

View the Answer

Page 3 of 11«12345»...Last »