Puzzle 1 : Take a chill pill!

This is one of the Microsoft interview questions, should be easier to answer as writing a code is not required. đŸ™‚

“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?”

By scale I mean a digital weight measuring machine.

SOLUTION:

1. Mark the jars with numbers 1, 2, 3, 4, and 5.
2. Take 1 pill from jar 1, take 2 pills from jar 2, take 3 pills from jar 3, take 4 pills from jar 4 and take 5 pills from jar 5.
3. Put all of them on the scale at once and take the measurement.
4. Now, subtract the measurement from 150 ( 1*10 + 2*10 + 3*10 + 4*10 + 5*10)
5. The result will give you the jar number which has contaminated pill.

11 comments so far

  1. FieryShadow on

    Solution Hidden

  2. Gaurav on

    This was a simple one i guess!

  3. Fr0z3n on

    Fiery got it correct. Thanks for hiding it. Let us see others coming up with the same. đŸ™‚

  4. arindam on

    Well this is my solution…..I do not know how to hide this ( tell me someone)

    Solution Hidden

    Well I hope this is correct…..
    Kanishk this is a nice thing u have started…..

  5. FieryShadow on

    correct answer arindam đŸ™‚

  6. John, New Jersey, New York on

    answer is?

  7. Fr0z3n on

    I have added the answer to the main post. Congratulations to Fiery and Arindam for getting it right.

  8. DarK on

    good one.. I never got it correct

  9. Puzzle on

    Can i use binary operators in my solution??

  10. Puzzle on

    Oh Sorry…. I posted in the wrong article

  11. Venkat on

    The idea is to form a different weight set from each jar in by picking consecutive numbers from each jar and weighing. If I got 149 then first jar is the one, if I got 148 then the second jar and so on.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: