« Wow moment ! | Main | Threading hair while on pthreads »

Programming Puzzles

There are 10 sacks containing coins, inside a room. There is a balence outside the room that you can use to weigh and find the sack that has all counterfiet coins. The coins are all same type, say quarters. 

You are allowed to enter the room once. Take as many coins as you want, bring them out and find which sack has all the counterfiet coins. There are plenty of empty sacks inside the room for your use.

It has been a common riddle for some 20+ years, and was asked in different job interviews to see the presence of mind of a candidate.

  • It is clear that you will have bring some coins outside to weigh and decide. You can not bring the balence inside. So you will have to have some ways of identification mechanims, to tell which sacks has counterfiet coins.
  • Once you find the solution to identification, next is to find the sack by weighing your sample.
  • Finally How can you find the solution in minimum number of weighing ?

 

 


Posted on Saturday, January 25, 2020 at 08:45AM by Registered CommenterProkash Sinha | Comments Off