# Comment On All Over the Map, Odd Shaped Container, and The Ideal Pair Programmer

All Over the Map (from Peter Banner) On paper, the candidate looked like a perfect fit. He had a very impressive résumé and seven years of experience in C#, C++, VB .NET, SQL, Oracle, and pretty much every other technology under the sun. Obviously, I had high expectations, as did my co-interviewer. [expand full text]
 « Prev Page 1 | Page 2 | Page 3 | Page 4 | Page 5 | Page 6 Next »

### Re: All Over the Map, Odd Shaped Container, and The Ideal Pair Programmer

2010-03-26 12:35 • by golddog (unregistered)
 --Put water into both jugs, stopping when they're about 3/4 full. --Add malted barley which you've prepared into wort, and yeast. --Cap both container with a valve to let the CO2 off and wait a few days until the fermentation is done. --Bottle contents with a little finishing sugar, cap, and wait a little more. --Enjoy!

### Re: All Over the Map, Odd Shaped Container, and The Ideal Pair Programmer

2010-03-26 13:26 • by Dennis (unregistered)
303812 in reply to 303492
 Anon: Dennis:it's wrong because the UNWRITTEN assumption is that the 4 gallons has to end up in the 5-gallon container. It's not an UNWRITTEN assumption. It's the only solution to the problem as stated. If you redefine the problem by adding some external, like your fish tank, then you are solving a different problem. I guess you could call it an assumption since the 5 gallon container is the only one large enough to hold 4 gallons, but if you're not capable of figuring that out yourself... Bzzzzzt! Wrong! But thanks for playing. The exact question is "How would you get four gallons of water?". NOT "How would you end up with 4 gallons of water in one of the containers?". In ENGLISH (the language I'm speaking, and the language the problem is written in), "get 4 gallons" does not MEAN or even IMPLY that it has to end up in the 5-gallon jug. You may ASSUME that's what it means, but that's just an assumption. And based on the puerile cheapshot at the end of your post (which I suppose you think strengthens your argument), I'd say the first 3 letters certainly apply. And if you still disagree, please post the EXACT WORDS that indicate SPECIFICALLY that the water should end up in one of the jugs, WITHOUT requiring an assumption. I'm not gonna hold my breath...

### Re: All Over the Map, Odd Shaped Container, and The Ideal Pair Programmer

2010-03-26 13:31 • by Matt (unregistered)
303814 in reply to 303540
 Anon: Anon: Jeff Dege:Actually, I was more interested in the "how would you weight a 747" question, from the click-thru. I'd weigh it the same way I weight my dog. He's a small dog, but he won't sit still on the scale, so I have to hold him. So, first I stand on the scale and weigh myself. Then I pick up the 747 and step on the scale again. Then I subtract. A friend of mine was asked this in an interview for a business-consulting (non-IT role). The interviewer obvisouly didn't read his resume (which included pilotting 747s). So when he was asked about it and he quoted the exact height (both unladen and full of fuel), it left the interviewer dumbstruck. I was also dumbstruck. I didn't know that the height of a 747 changed depending on whether or not it was full of fuel. On the other hand, how much does it weigh? I would imagine the weight of the fuel would cause the undercarriage suspension to compress a little so the height would also change ... I'd be rather worried if it didn't :o)

### Re: All Over the Map, Odd Shaped Container, and The Ideal Pair Programmer

2010-03-26 17:14 • by hellosalute (unregistered)
303835 in reply to 303793
 DaveK: Josephus: Name:For those who wonder about the bottles: ```3 5 -- #1 and #2 --------------- 0 5 -- fill #2 3 2 -- put 3 in #1 0 2 -- empty #1 2 0 -- empty #2 in #1 2 5 -- fill #2 3 4 -- fill #1 with #2``` wow, not hired. Inability to explain simple things in a comprehensible manner. wow, not hired. Inability to infer the meaning of a trivially obvious domain-specific notation. wow, not hired. Inability to have enough ass in his pants.

### Re: All Over the Map, Odd Shaped Container, and The Ideal Pair Programmer

2010-03-26 17:22 • by gilhad (unregistered)
 I did not know the water problem before, but I solved it in head on the spot. But it did not make me happy to came with so trivial solution, so I also elaborated couple of others, some of which was also in comments ... it all depends on the REASON to solve such restricted problem in unusual ways ... and on your creativity :) About manipulating water without planet or celestial body - it is also not problem, if you can accelerate/decelerate/rotate your space vehicle :) And the car problem have also nice ultimate solution to make happy all (provided you cannot mobile for help etc.) - let your friend drive your car, the dying person will came into luggage hold (well it is dying, so the transport is more important than comfort). You sit on the other seat in car, which left the only logical and possigle place for the hottie - to sit on your lap. Drive to hospital first, then to friends target, then you can take the hottie home alone :) Everybody get ride, everybody satisfied :) (Well actually i had seen many project programed in this way - to carry 4 people in 2 seat car)

### Re: All Over the Map, Odd Shaped Container, and The Ideal Pair Programmer

2010-03-26 17:58 • by seebs
 When I was a little kid, that was on a test the school gave me -- given 5 and 3 quart jars, obtain exactly two quarts of water. I had walked them through how, given a stick of a fixed length, and the noon sun, you could make markings at reasonable distances on one of the jars, and finally the tester gave up and told me about the idea of filling the 5 quart jar, filling the 3 quart jar from it, and having 2 quarts left. I stared blankly for some period of time, then announced "You can get any number from one through eight." I still don't know whether I got credit, but I'd guess I didn't.

### Re: All Over the Map, Odd Shaped Container, and The Ideal Pair Programmer

2010-03-26 19:31 • by daddy (unregistered)
303841 in reply to 303485
 Your answer is correct. You can have a beef against people who'd say your answer is incorrect but there's nothing wrong with the problem itself. Maybe you've just interacted with the wrong kind of problem-askers. A good asker might go with "yes, that's correct. Now suppose the fishtank is too heavy to carry, and it's far from the spout. Could you find a way to put the 4 gallons in without taking as many trips back and forth?" He'd do that if he wants to give you another interesting problem (assuming you'r doing them for fun), or because (for some reason) he realizes he forgot to make the assumption explicit, so he fixes that now.

### Re: All Over the Map, Odd Shaped Container, and The Ideal Pair Programmer

2010-03-26 19:52 • by Boss (unregistered)
303842 in reply to 303793
 DaveK: Josephus: Name:For those who wonder about the bottles: ```3 5 -- #1 and #2 --------------- 0 5 -- fill #2 3 2 -- put 3 in #1 0 2 -- empty #1 2 0 -- empty #2 in #1 2 5 -- fill #2 3 4 -- fill #1 with #2``` wow, not hired. Inability to explain simple things in a comprehensible manner. wow, not hired. Inability to infer the meaning of a trivially obvious domain-specific notation. wow, fired. Inability to understand the difference between a correct answer and a good answer. If you can't communicate with your customer then you are only 10% as useful as someone who can. Doesn't matter how well you can use dev-speak.

### Re: All Over the Map, Odd Shaped Container, and The Ideal Pair Programmer

2010-03-27 00:20 • by Mike (unregistered)
303844 in reply to 303691
 P.M.Lawrence: agrif: Anon: AndersI:I would put the five gallon bottle on the scale and fill water into it until it is 4 kg heavier. Great answer. Put it on the scale that the problem explicitly stated that you didn't have. Even better, 4 kg of water is 4 liters, not 4 gallons. You'd want 32 pounds (a pint's a pound the world around, unless you lived in civilized nations where a pound is for dogs) That US mnemonic ("a pint's a pound the world around") is factually incorrect, because in most parts of the world where those units are used at all "a pint of water weighs a pound and a quarter". That would leave a gallon of water weighing 10 pounds, which is does not. A gallon of water weighs slightly over 8 pounds, part of which will be the weight of the container I used to hold the water while I weighed it. I was unable to set a tare weight due to the fact that I used a seaped gallon of purified water, and I didn't have another gallon jug handy. Also, this calculation was made approximately 745 feet above sea level, very near midnight local time, with a waning gibbous moon.

### Re: All Over the Map, Odd Shaped Container, and The Ideal Pair Programmer

2010-03-27 07:03 • by Duh! (unregistered)
303849 in reply to 303844
 Mike: P.M.Lawrence: That US mnemonic ("a pint's a pound the world around") is factually incorrect, because in most parts of the world where those units are used at all "a pint of water weighs a pound and a quarter". That would leave a gallon of water weighing 10 pounds, which is does not. Allowing for a bit of variance due to thermal expansion and impurities, it does. Practically everywhere in the world except the USA.

### Re: All Over the Map, Odd Shaped Container, and The Ideal Pair Programmer

2010-03-27 14:09 • by Random832 (unregistered)
303857 in reply to 303487
 Ozz:You left the service manual in your other pants. Now what do you do? I go to Boeing, and offer to trade a barometer for the service manual.

### Re: Odd Shaped Container

2010-03-28 16:01 • by puzzled (unregistered)

### Re: All Over the Map, Odd Shaped Container, and The Ideal Pair Programmer

2010-03-28 21:22 • by lolwut (unregistered)
 WHARTON, lol!

### Re: All Over the Map, Odd Shaped Container, and The Ideal Pair Programmer

2010-03-28 23:44 • by Kef Schecter (unregistered)
303884 in reply to 303710
 Iago:Seriously, if you think it's difficult to add and subtract tiny integers in your head, please stop programming immediately. If you think programmers need to add and subtract tiny integers in their heads to be able to program well, please stop interviewing them immediately. I've been a programmer -- largely, but not only, as a hobbyist -- for over ten years and I'm rarely ever required to do it. And no, I'm not particularly good at it. I don't need to be good at it. Can you name even one programming problem where that skill is required or even particularly useful? The computer is perfectly capable of adding and subtracting numbers so I don't have to. It's not just me, though. I know that some of the greatest mathematical minds in history were not particularly good at adding or subtracting small numbers without using a calculator (or at least pencil and paper). There is surprisingly little correlation between mental calculation and general mathematical or computational skill. Don't believe me? Try to get Rain Man to solve the water bottle puzzle. - Kef

### Re: All Over the Map, Odd Shaped Container, and The Ideal Pair Programmer

2010-03-29 00:20 • by CBM (unregistered)
303886 in reply to 303493
 I would put the five gallon bottle on the scale and fill water into it until it is 4 kg heavier. 4Kg? Trying that in a NASA interview might be seen as poor taste.

### Re: All Over the Map, Odd Shaped Container, and The Ideal Pair Programmer

2010-03-29 04:24 • by Lang Sharpe (unregistered)
 Our compensation reflects the importance of this position Your being paid to be a typist. You'll be paid the same as a typist?

### Re: All Over the Map, Odd Shaped Container, and The Ideal Pair Programmer

2010-03-29 07:48 • by kfh (unregistered)
303896 in reply to 303504
 You jest, but.... In Basic, on a Prime machine (IIRC) circa 1981, this was actually possible. If you made a typo like "LET 5=4;" and then printed the value of the number 5, it would print 4. Oh, the pain....

### Re: All Over the Map, Odd Shaped Container, and The Ideal Pair Programmer

2010-03-29 08:52 • by Dr. Evil (unregistered)
303899 in reply to 303783
 PITA:There are two water bottles. One can hold exactly three gallons and one can hold exactly five gallons. There is no scale, no dividing lines, and the bottles are odd shaped, meaning no visual measurement is possible. You can, however, empty and fill the bottles with water as many times as you want. How would you get four gallons of water? Out of the tap?WIN!!

### Re: Mmmm....

2010-03-29 09:09 • by ParkinT
303902 in reply to 303467
 Hi OJ:Perhaps they meant Au pair programming???? Captcha: gravis (what a great game pad!) Who looks for a job on Craigslist?! I would expect an ad for Ménage à trois Programming, maybe.

### Re: All Over the Map, Odd Shaped Container, and The Ideal Pair Programmer

2010-03-29 14:57 • by VRAndy
303951 in reply to 303452
 Anon:I think your interview questions are a little weak. The "Why do you like C# more than VB" can demonstrate someone's familiarity level with both languages, but that's about it. That is probably exactly why it was asked. Demonstrating basic familiarity with the things you wrote on the resume is often the first goal of an interviewer. It doesn't take long and allows you to quickly eliminate a surprising number of people.

### Re: All Over the Map, Odd Shaped Container, and The Ideal Pair Programmer

2010-03-29 14:58 • by anonymous (unregistered)
303952 in reply to 303540
 Anon:I was also dumbstruck. I didn't know that the height of a 747 changed depending on whether or not it was full of fuel. It has air-filled tires, you know.

### Re: All Over the Map, Odd Shaped Container, and The Ideal Pair Programmer

2010-03-30 06:40 • by Carra (unregistered)
 Heck, I came up with two different methods which require a basin. -2x5 in the basin -2x3 out of the basin -Done!

### Re: All Over the Map, Odd Shaped Container, and The Ideal Pair Programmer

2010-03-30 10:13 • by Nessuno (unregistered)
304014 in reply to 303766
 Abdiel: RogerInHawaii: Zapp Brannigan: alegr: AndersI:I would put the five gallon bottle on the scale and fill water into it until it is 4 kg heavier.Who would have thought one gallon weights one kilogram... Oh, wait...No one specified the planet. Are you assuming it's Earth? Ummm, kilogram is a measure of mass, not weight. Right? So it wouldn't matter what planet you're on, or even that you're on a planet. You might find it difficult to pour anything anywhere if you are not located on a planet, or at least another suitable celestial body providing a reasonable gravitational pull. Well, you can always just rotate. Inertia takes care of the rest.

### Re: All Over the Map, Odd Shaped Container, and The Ideal Pair Programmer

2010-03-31 07:45 • by Ren
 I never understood why the water 'puzzle' is defined as a 'logic' problem, it's just to do the ONLY move that doesn't end in an initial state and it's completely linear. It's like solving a 3-move chess/go problem. Correct me if I'm wrong: 5* 0; 2 3*; 2 0; 0 2; 5* 2; 4 3*; done The 'pair programmer' doesn't look like a bad part-time position, really. Has TDWTF degraded into laughing at people who actually might know what they're doing but who don't necessarily have the exact words to describe them? And before you complain about the 'excellent English skills' part, that's just what's in every (non-British, since that's discrimination over there) application anyway.

### Re: All Over the Map, Odd Shaped Container, and The Ideal Pair Programmer

2010-04-06 17:32 • by Maurice (unregistered)
304788 in reply to 303464
 No its not a good question the containers are described as bottles try putting a normal size coke bottle inside a 1.5L coke Bottle some time. And if they where open topped cans it wouldnt realy be 4 Gallons as the 3 gal container would displace slightly more than 3 gals of water the container it's self would displace water.

### Re: All Over the Map, Odd Shaped Container, and The Ideal Pair Programmer

2010-06-12 16:20 • by lisa (unregistered)
 at least the ad for pair programmer was honest! I've seen one too many cases where one person severely dominates while "pairing"...it gives the whole process a bad name.

### Re: All Over the Map, Odd Shaped Container, and The Ideal Pair Programmer

2010-06-22 18:47 • by Mark J. (unregistered)
312641 in reply to 303462
 bottlefiller: Name:For those who wonder about the bottles: ```3 5 -- #1 and #2 --------------- 3 0 -- fill #1 0 3 -- put 3 in #1 3 3 -- fill #1 1 5 -- empty #1 in #2 1 0 -- empty #2 0 1 -- empty #1 into #2 3 1 -- fill #1 0 4 -- empty #1 into #2 ``` I especially like the part where two gallons magically disappear out of bottle #1! CAPTCHA: acsi - a crime scene investigator?

### Re: All Over the Map, Odd Shaped Container, and The Ideal Pair Programmer

2010-09-04 04:54 • by dgghua (unregistered)
 Thank You for the post. I love to read interesting post that has knowledge to impart. I hope to read more articles from you and in return I will post also my articles in the forum so that others can benefit from it. Keep up the good work!Rosetta stone learning software worthy of trust,Rosetta Stone Rosetta Stone Spanish the effect is very obvious, guarantee our product, progress quickly!

### Re: All Over the Map, Odd Shaped Container, and The Ideal Pair Programmer

2010-11-24 13:08 • by Ol' Bob (unregistered)
 The Ideal Pair Programmer - OMG! WTF?!? Please - do yourself a huge favor - go to the http://broadstreetanalytics.com/team.html page and have a look at their 'team'. Read carefully, but try not to annoy those near you with subsequent chuckles, chortles, guffaws, and/or giggles. Highlights - the CEO lists his high school graduation; his big-time experience is in the MBS market - yes, that's "Mortgage Backed Securities" - where he was in charge of developing their mortgage credit model - OMG!!! The COO has apparently dropped out of the Ph.D. program at Wharton, but he's still shown on their website at http://opimweb.wharton.upenn.edu/people/faculty.cfm?id=74. Run screaming!; the "Senior Designer" has multiple degrees in Architecture - not **Software** Architecture, but the kind involved in putting up buildings - he's in charge of their wonderful website, so check this page http://broadstreetanalytics.com/technology.html and note that the white text bleeds off into the white background on the right - but hey, he's got multiple degrees so it *must* be great; and their Software Developer (Pair Programmer???) has an MS in Comp Sci to top off his BS in International Studies - WTF? ROFLMAO!

### Re: All Over the Map, Odd Shaped Container, and The Ideal Pair Programmer

2011-01-03 22:07 • by drfreak
 Although I've watched all the Die Hard movies, I do not remember the water riddle; however, because no requirement was given to put water in both bottles I'd just put four gallons into the five gallon bottle and be done with it. As an added bonus, just take a typical five gallon office bottle and pour it in, no measurement required.

### Re: All Over the Map, Odd Shaped Container, and The Ideal Pair Programmer

2011-01-03 22:08 • by drfreak
333482 in reply to 333481
 Oops, I created my own WTF. Ok, pour five gallons from the office bottle into the four gallon container and let the rest spill out. Done!

### Re: All Over the Map, Odd Shaped Container, and The Ideal Pair Programmer

2011-07-11 05:12 • by Prism (unregistered)
352932 in reply to 303478
 James:I'd go with the alternate solution: #1 is the 5 gallon jug #2 is the 3 gallon jug Fill #1, empty it into #2, so 2 gallons left in #1. Grab the sharpie off your desk, mark the water level. Dump #2 out. Pour the 2 gallons into #2. Refill #1 to the mark, then dump the 2 gallons from #2 back in. Fill the 5g, fill 3g from 5g, point to the 5g and say "I have 2 gal, let me know when you need 2 more" When the interviewer balks, tell him you are demonstrating an asynchronous function, caching and reducing processor load by eliminating needless steps.

### Re: All Over the Map, Odd Shaped Container, and The Ideal Pair Programmer

2011-07-11 05:41 • by Prism (unregistered)
352940 in reply to 303593
 zelator:Best question ever: If a hen-and-a-half can lay an egg-and-a-half in a day-and-a-half, how many one-and-a-half egg omelettes can you make in a week-and-a-half? None. I have no eggs or hens. ---- Two cars are driving towards each other at 60 mph, on the front bumper of one car is a fly who will fly back and forth between the cars until they crash together, the fly can fly 120 mph at all times, given the cars are two miles apart, how far will the fly fly before it meets its fate? --- Fast as you can, name 3 animals whose names start with a double letter -- ex. Ccat. --- How about a really hard one? Given a specified desktop area, with a set of randomly placed windows, give an algorithm that would pick the window most like a target window in terms of size, location, and proportion. Solution should correct for any results that would appear non-intuitive to a human should they exist. Bounds and limits: Windows max size is the desktop, and windows will always have some portion showing on the desktop.

### Re: It's a simple counting problem

2011-07-11 06:16 • by Prism (unregistered)
352941 in reply to 303693
 RogerInHawaii:Fill the 3 gallon container. Count the number of water molecules in it. Divide by 3 to get the number of water molecules in a gallon of water. Put that number of water molecules in the 5 gallon container. Isn't everyone in this forum a computer programmer, or at least familiar with computer programming? Don't we deal with digital computers? So why address this problem from an analog perspective, i.e. measuring the water instead of counting it? First of all, to get all technical on your 'spec' -- I believe that there is only ONE molecule of water in any cohesive glob of water. At least I heard that somewhere. Second, your spec also uses analog measure in the beginning, why not simply say "reach into the 5 gal container and extract the appropriate number of ATOMS that will be sufficient to produce 4 gallons of water at the given temperature and air pressure."? Your solution 'violates the analogy' IMO. It would be like saying "We can unit test by peeling the top off our CPU and Memory at the right moment and peer in with an electron microscope to see if the results are as expected" Sure, all this is possible, if you happen to be GOD. -- I will give my answer again that I have already posted, because so far, I think its the best: Fill 5g, dump 3g into 3g, point at the 2g remaining in the 5g and say to the interviewer "I now have 2g, let me know when you need the other 2g" When he balks, tell him you are demonstrating an asynchronous function, caching, and also reducing processor workload compared to the typical solution.

### Re: All Over the Map, Odd Shaped Container, and The Ideal Pair Programmer

2012-10-25 12:10 • by Mike (unregistered)
393368 in reply to 303450
 Old post I realize but perhaps the senior developer is a code ninja but has CTS or something. They don't want to lose their rockstar so they are willing to pay \$20/hr extra for a secretary.

### Re: All Over the Map, Odd Shaped Container, and The Ideal Pair Programmer

2013-10-31 09:37 • by Isikyus (unregistered)
420217 in reply to 303493
 Congratulations! You now have four metric gallons of water.

### Re: All Over the Map, Odd Shaped Container, and The Ideal Pair Programmer

2013-12-10 05:25 • by Link to the company of paired programming (unregistered)
 http://www.ufora.com/company/team/ ROFL
 « Prev Page 1 | Page 2 | Page 3 | Page 4 | Page 5 | Page 6 Next »