|
-
Dec 8th, 2006, 01:38 PM
#13
Re: Coding aptitude test
Here is a puzzle that you could ask.
You have got a 7 Gallons jar and a 12 Gallons jar you have to measure exactly 3 Gallons and put it in a radiator
you have ample water supply but no third jar and no markings allowed on the jars
This is one possible solution.
here u go...
0 0 (start)
0 12 (fill 12 gallon jar)
7 5 (transfer 7 gallon from 12 gallon jar)
0 5 (empty 7 gallon jar)
5 0 (transfer 5 gallon to 7 gallon jar)
5 12 (fill 12 gallon jar again)
7 10 (transfer 2 gallon to 7 gallon jar)
0 10 (empty 7 gallon jar again)
7 3 (transfer 7 gallon to 7 gallon jar)
remaining 3 gallon in 12 gallon jar...
Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
save a blobFileStreamDataTable To Text Filemy blog
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|