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

« Return to Article
  • joe.edwards 2010-03-25 10:05
    I will dictate my comment and the pair commenter will type it in.
  • Jim the Electrician 2010-03-25 10:05
    Apparently I'm a fast typist, because the post was still available on Craigslist when I looked.
  • PeriSoft 2010-03-25 10:08
    You can, however, empty and fill the bottles with water as many ties as you want. How would you get four gallons of water?

    Wait - can you fill the bottles with water, or with ties? Where do you even get enough ties to fill a 5-gallon bottle? Are we talking neckties, bow ties, or tie fighters?

    This is very confusing.
  • psuedonymous 2010-03-25 10:11
    You cannot put four gallons into these bottles because they are odd shaped.
    Maybe he assumed that not only is water quantised, but must maintain it's odd/even state.

    Regardless, for making such a truly terrible pun he should also never have been hired.
  • Alargule 2010-03-25 10:12
    "You cannot put four gallons into these bottles because they are odd shaped."

    Took me quite a while to figure that one out...:-D
  • Robert 2010-03-25 10:13
    Shoot the hostage.

    Crap, wrong movie/riddle
  • frits 2010-03-25 10:14
    You can pick your pair programmer at will call.
  • AndrewB 2010-03-25 10:16
    I think we need to get four gallons of ties in a five gallon hat.
  • b 2010-03-25 10:20
    Without the live link to the last one I would never have believed that such a thing was actually real... You would think that a *wharton PhD* would have taught them about wasting money... guess not. *sigh*

    captcha: abico: The World's Premier Workforce Management Solution
  • Chris 2010-03-25 10:22
    I guess they are referring to
    Pair Programming, but nevertheless one is reviewing while the other is typing.. not typing while the other is dictating.
  • Anon 2010-03-25 10:23
    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. Unless you are interviewing for someone who agrees with your opinions one code-style and technique, it's a silly question. Personally, I don't care if they know the little nuances of the language, but rather if they can solve common programming problems.

    The water question isn't even a brain teaser. Just a little proof of whether or not you read a book of brain-teasers before. Sure, a few people will solve it without knowing the answer beforehand, but probably not without wasting a lot of precious interview time doing the arithmentic in their heads.
  • odd shaped 2010-03-25 10:23
    Did they put a mirror under his nose, then? Did he manage to fog it up?
  • Me 2010-03-25 10:25
    We should all flag that "Best of Craigslist"
  • Jack 2010-03-25 10:25
    Wow! the links on this broadstanalytics.com are all like this: href='/?epl=03280043VGsLXARdBQZXBkQHVwgHWg9aB1oGCFUTDlRRS0xVXwRZTRZRWhYdVw5dRARXCjlBBFIDRQZHCgkVQUUCFxtTF1pVBktNBF1VDUkWClsWSFAOWUkRF0YKUFMDDA0KAghSARIMV006UVgOUwkGXFhAVg9AFFgTTApRTwEEAQ0SRQBGQD1RXVgDEg5AFl5XC0BDDkQTWQdQRVwOWxNLXVVDBl1rEldKWFFbFRYGBksMAV0_XQIKVAMGRwJUQV1fW0McCFMHVlwXWldHQw4KWwA5WgUJVhEQUFYTAl1qTEFEVFhZXQxTHwRfWA5HPQRXCgFfBGsMRF4F&query=botsearch09'

    Imagine dictating that!
  • Name 2010-03-25 10:25
    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
  • neveralull 2010-03-25 10:28
    When we interview candidates, we feel that everthing listed on the resume is an invitation for us to ask technical questions about, but we don't necessarily hold it against the candidate if he admits that he is weak in a certain area. But my candidate got mad and started yelling at me becuase I was asking too many technical questions. He said he was strong in C++, so one of my questions was for him to give an example of when he would use a template. "I would never use a template," he said with a raised voice. I asked why, and he answered because he doesn't know anything about templates. An honest answer, but I didn't like his attitude. Other interviewers at the company liked him, for what reasons I have no idea.
  • Patrick 2010-03-25 10:32
    “of course, Greece! I know so very much about those countries, and love them too. Especially Greece!”

    yes, well, we're looking for someone who knows very much about PROGRAMMING. And loves it. Especially the programming part.

    NEXT!
  • Patrick 2010-03-25 10:38
    Does the Senior Programmer have no hands with which to type? That would certainly explain the need to dictate to a typist, and a typist who actually understands the code enough to not cause frustration in debugging and formatting.

    captcha: vindico. the company that vindicates WTFs Daily...
  • bottlefiller 2010-03-25 10:43
    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
  • Remy Porter 2010-03-25 10:46
    No, it's a good question. I don't care which they actually prefer, but I like to see how their brain works. I sit in on a lot of interviews. The <i>way</i> someone answers a question is more important than the actual answer.

    And honestly, I'm not really certain what the "right" answer is to the 3/5 gallon problem. My answer? Put the 3 gallon container in the 5 gallon container, fill the 5 gallon container. Take the 3 gallon out, and put the two gallons you just made into the 3 gallon container. Repeat, but this time pour the 2 gallons in the 3 gallon container into the 5 gallon container.
  • Grand Poobah 2010-03-25 10:48
    Gul Madred: How many gallons do you see there?
    Picard: I see four gallons
    Gul Madred: No, there are five. Are you quite sure?
    Picard: There are four gallons.

    Captha: nobis (ora pro)
  • Hi OJ 2010-03-25 10:50
    Perhaps they meant Au pair programming????

    Captcha: gravis (what a great game pad!)
  • drachenstern 2010-03-25 10:51
    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?
    unless we're in the same (or a similar) predicament as the movie, I would personally goto <insert name of local grocer / mass market retailer of beverages> and BUY 4 gallons of water. A gallon of water at most grocers is ~$1 so I'm out $4. As a programmer in a respectable firm, if that $4 costs me too much, I've got other issues.

    Whaddaya need 4 gallons for anyways? The 5 shoulda been enough. Ya can always throw the extra gallon out the door.
  • Igni 2010-03-25 10:55
    Those of you that think that job posting is bizarre have obviously never had RSI. Just sayin'.
  • anon 2010-03-25 10:56
    Or a condition like Parkenson's that makes typing difficult. Still, training a computer to do the work, with a human cleaning up might be more efficient.
  • Patrick 2010-03-25 10:59
    drachenstern:
    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?
    unless we're in the same (or a similar) predicament as the movie, I would personally goto <insert name of local grocer / mass market retailer of beverages> and BUY 4 gallons of water. A gallon of water at most grocers is ~$1 so I'm out $4. As a programmer in a respectable firm, if that $4 costs me too much, I've got other issues.

    Whaddaya need 4 gallons for anyways? The 5 shoulda been enough. Ya can always throw the extra gallon out the door.


    Redefining the problem to avoid doing the work. Interesting. "It's not a bug, it's a feature. Just work around it."
  • All-Beef Patty 2010-03-25 11:01
    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. Unless you are interviewing for someone who agrees with your opinions one code-style and technique, it's a silly question. Personally, I don't care if they know the little nuances of the language, but rather if they can solve common programming problems.


    I've often asked this style of question (usually I pick two databases they claim to have worked with, or two OSes). When I ask, I'm not looking for them to agree with what I think. It's part BS detector -- do they know enough about the things they put on their resume to give an informed comparison? It's also a view into how the person thinks. And I'm perfectly okay with answers like "I've been working with X for 5 years and Y for about 3 months, so I'm just more comfortable with X" The hardest part of conducting an interview is getting genuine responses rather than simply what the interviewee thinks you want to hear, and the best way to do that is to ask questions where the information you want has more to do with how the answer is presented than with the specifics of the answer.
  • sore 2010-03-25 11:01
    What is that water example for?
    Testing industrial robots?
  • Spivonious 2010-03-25 11:02
    Grand Poobah:
    Gul Madred: How many gallons do you see there?
    Picard: I see four gallons
    Gul Madred: No, there are five. Are you quite sure?
    Picard: There are four gallons.

    Captha: nobis (ora pro)


    I applaud your trekiness.

    captcha: nibh, where the rats went after nimh was destroyed?
  • Patrick 2010-03-25 11:05
    sore:
    What is that water example for?
    Testing industrial robots?

    It's supposedly for testing the candidate's problem solving / logical / analytical skills. But since the questions were all passed around in school years ago, they're not actually effective. The WTF here is that the company in question is using them in an interview, despite the fact that they are useless, and on top of that actually got a FAIL from it.
  • Jeff Dege 2010-03-25 11:09
    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.
  • James 2010-03-25 11:16
    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.
  • Mike 2010-03-25 11:17
    Me:
    We should all flag that "Best of Craigslist"


    That sounds like something 4Chan would do.
  • anon 2010-03-25 11:18
    I'd find the weight of the 747 by reading the service manual.

    That's the right answer, right?
  • Mike 2010-03-25 11:20
    Remy Porter:
    No, it's a good question. I don't care which they actually prefer, but I like to see how their brain works. I sit in on a lot of interviews. The <i>way</i> someone answers a question is more important than the actual answer.

    And honestly, I'm not really certain what the "right" answer is to the 3/5 gallon problem. My answer? Put the 3 gallon container in the 5 gallon container, fill the 5 gallon container. Take the 3 gallon out, and put the two gallons you just made into the 3 gallon container. Repeat, but this time pour the 2 gallons in the 3 gallon container into the 5 gallon container.


    Please don't ever try to solve a problem for me.
  • Jason 2010-03-25 11:20
    I assume the "Pair Programmer" is for someone with wrist damage or similar. A good programmer who's a company founder and can hire someone to be a keyboard monkey.

    Sounded like a good solution to me.. if that's the situation.
  • Dan 2010-03-25 11:22
    Patrick:
    Does the Senior Programmer have no hands with which to type? That would certainly explain the need to dictate to a typist, and a typist who actually understands the code enough to not cause frustration in debugging and formatting.


    Or severe carpal tunnel syndrome
  • dkf 2010-03-25 11:22
    Jeff Dege:
    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.
    But you can get a 747 to sit still. Especially if you've got a BA crew…
  • Dennis 2010-03-25 11:22
    What bugs me about these types of tests is the assumptions they make, and if you ask for clarification they say "just answer the question" (meaning they don't have an answer for you). In this case, they don't actually say the 4 gallons has to end up in the 5-gallon container, just that you have to *get* 4 gallons. So I would do this: fill the 5, pour 3 into the 3 from the 5, leaving 2. Pour the 2 into wherever it is that you need the water (fishtank?). Repeat. That's 4 gallons in the fishtank. Of course it's wrong because the UNWRITTEN assumption is that the 4 gallons has to end up in the 5-gallon container.
  • facilisis 2010-03-25 11:26
    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.


    I would fill the 3 gallon jug, and then tell the end user it's a 4 gallon jug. If he really needs another gallon, he'll get it somewhere. Water isn't hard to find. More likely, he just doesn't understand his own requirements, and will be perfectly happy with what I give him.
  • Ozz 2010-03-25 11:26
    anon:
    I'd find the weight of the 747 by reading the service manual.
    That's the right answer, right?
    You left the service manual in your other pants. Now what do you do?
  • sino 2010-03-25 11:26
    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. Unless you are interviewing for someone who agrees with your opinions one code-style and technique, it's a silly question. Personally, I don't care if they know the little nuances of the language, but rather if they can solve common programming problems.

    The water question isn't even a brain teaser. Just a little proof of whether or not you read a book of brain-teasers before. Sure, a few people will solve it without knowing the answer beforehand, but probably not without wasting a lot of precious interview time doing the arithmentic in their heads.
    what. ಠ_ಠ
  • Remy Porter 2010-03-25 11:29
    Why not, it works, doesn't it? So long as the walls of the container are thin negligible to the volume of the container, you're all good.

    I admit, it's not as good as the marker idea, which is really the best answer I've heard, but it does assume extra equipment.

    But displacing 3 gallons of volume in a 5 gallon container means the remaining volume is 2 gallons. We've now graduated our 5 gallon container.
  • drachenstern 2010-03-25 11:30
    Patrick:
    drachenstern:
    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?
    unless we're in the same (or a similar) predicament as the movie, I would personally goto <insert name of local grocer / mass market retailer of beverages> and BUY 4 gallons of water. A gallon of water at most grocers is ~$1 so I'm out $4. As a programmer in a respectable firm, if that $4 costs me too much, I've got other issues.

    Whaddaya need 4 gallons for anyways? The 5 shoulda been enough. Ya can always throw the extra gallon out the door.


    Redefining the problem to avoid doing the work. Interesting. "It's not a bug, it's a feature. Just work around it."
    reaction #1:
    Oh if only you knew me. Then you would know that I just won't waste my time pouring water back and forth unless it's necessary. I could be writing code ya know.
    or reading <TDWTF|/.|digg|reddit|whatever>
    reaction #2:
    You've seen some of my other open source projects then?
    no not really

    New TDWTF comment activity for fun! ^^^^^^^^^^^^^^^^^^
  • drachenstern 2010-03-25 11:32
    facilisis:
    I would fill the 3 gallon jug, and then tell the end user it's a 4 gallon jug. If he really needs another gallon, he'll get it somewhere. Water isn't hard to find. More likely, he just doesn't understand his own requirements, and will be perfectly happy with what I give him.
    QFT
  • Anon 2010-03-25 11:33
    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...
  • AndersI 2010-03-25 11:37
    I would put the five gallon bottle on the scale and fill water into it until it is 4 kg heavier.
  • Anon 2010-03-25 11:38
    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.


    Then you fail at interviewing. It's actually a very good question which can reveal a lot about a person. First, if they can't point to at least a couple of features that differ between the two languages, then they are lying about being familiar, which is pretty useful to know. Second, if they can talk in depth about the pro's and con's of each, it demonstrates that they have a real passion for programming.
  • Ducky 2010-03-25 11:38
    But, those with severe carpal tunnel but is otherwise a proficient programmer can still use voice recognition software rather than hiring someone. The suspicious part of the ad has to do with the fact that the "senior programmer" wants to "dictate" to the "junior programmer" at a "high level".
  • Anon 2010-03-25 11:39
    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.
  • Anon 2010-03-25 11:45
    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.
  • the beholder 2010-03-25 11:47
    drachenstern:
    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?
    unless we're in the same (or a similar) predicament as the movie, I would personally goto <insert name of local grocer / mass market retailer of beverages> and BUY 4 gallons of water. A gallon of water at most grocers is ~$1 so I'm out $4. As a programmer in a respectable firm, if that $4 costs me too much, I've got other issues.

    Whaddaya need 4 gallons for anyways? The 5 shoulda been enough. Ya can always throw the extra gallon out the door.
    Hah! I'm not hiring you now, because your answer wastes money. Unless it's your money, of course.

    But if it's my money, why would you buy 4 gallons of water, when you can just buy one and use the 3 gallon water bottle?
  • someGuy 2010-03-25 11:49
    wow small world!, so I know Braxton (the guy from the craig's list posting). He has severe carpal tunnel
  • drachenstern 2010-03-25 11:53
    the beholder:
    drachenstern:
    A gallon of water at most grocers is ~$1 so I'm out $4. As a programmer in a respectable firm, if that $4 costs me too much, I've got other issues.

    Whaddaya need 4 gallons for anyways? The 5 shoulda been enough. Ya can always throw the extra gallon out the door.
    Hah! I'm not hiring you now, because your answer wastes money. Unless it's your money, of course.
    drachenstern:
    Yeah, my own money, pretty sure I nailed that the first time around. Now, if you need to replicate the process repeatedly you need an engineer, not a software guy. Granted, I like to build mechanical contraptions, but...


    But if it's my money, why would you buy 4 gallons of water, when you can just buy one and use the 3 gallon water bottle?
    drachenstern:
    why do you need explicitly four gallons? Why can't you use the 5 gallon almost full? Seriously, the requirement is dumb to begin with.
    Glad to know you don't hire people because they're efficient. I always admire the zombies in FPS who walk into walls persistently. Do your employees need to be reminded to wipe their asses or wash their hands after using the toilet? "Just do what I asked, don't think about it"... may have worse implications than expected.

    </rant>

    eh... I feel woozy. What just happened there?

  • whichgallon 2010-03-25 11:54
    I'd fill the 5 gallon jug completely, if it's 5 US gallons. That's still 4 Imperial gallons.
  • SenTree 2010-03-25 11:56
    Remy Porter:
    Why not, it works, doesn't it? So long as the walls of the container are thin negligible to the volume of the container, you're all good.

    The original problem specified bottles which would mean the orifices are too narrow for insertion.
  • Rowan 2010-03-25 11:56
    I have a slightly faster solution to the bottle problem.

    #1 #2
    3 5
    0 5 Fill #2
    3 2 Fill #1 from #2
    0 2 Empty #1
    2 0 transfer the 2 from #2 to #1
    2 5 Refill the #2
    3 4 Top off #1 from #2, leaving 4 gallons behind.
  • Da' Man 2010-03-25 11:56
    DEFINE 5 4;
  • avflinsch 2010-03-25 11:59
    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


    But that is an even number of steps.
  • St Mary's Sanatorium for Severed Hands 2010-03-25 12:00
    Did anybody read this?

    The Pair Programmer is critical since the Senior Programmer aims to limit his use of the keyboard.


    This fits well with somebody who has carpal tunnel syndrome. I think dictating program code to be a WTF, but would it be more sensible to

    a) hire a junior programmer who does all the "dirty" work

    and

    b) let the senior one work out the tricky stuff - albeit writing these bits by himself? At least he could sketch his ideas with good ol' pencil and paper and leave the implementation to his junior.
  • Lennart 2010-03-25 12:00
    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.


    Was it a european or african 747?
  • drachenstern 2010-03-25 12:01
    Rowan:
    I have a slightly faster solution to the bottle problem.

    #1 #2
    3 5
    0 5 Fill #2
    3 2 Fill #1 from #2
    0 2 Empty #1
    2 0 transfer the 2 from #2 to #1
    2 5 Refill the #2
    3 4 Top off #1 from #2, leaving 4 gallons behind.
    but then you have 7 gallons, not four!!!
  • Remy Porter 2010-03-25 12:04
    SenTree:
    blem specified bottles which would mean the orifices are too narrow for insertion.


    Most expressions of that problem aren't that specific. Yes, in the case of bottles, that likely means the tops are too narrow. But then again, they are oddly shaped. This implies that our general assumptions about the bottles aren't safe, and that the bottleneck of the larger bottle could easily be large enough to insert a 3 gallon bottle.

    If the problem doesn't want the containers married, it should have specified it as impossible, not simply implied it.

    The issue is this: the "right" answer is tedious and boring. Bah, pour, empty, pour, empty. And it's tied to implementation- it'd be far more fun to solve the problem for any combination of containers and target volumes.
  • millimeep 2010-03-25 12:04
    ...and get 4 litres instead of 4 gallons?

    bzzzzt... next!
  • drachenstern 2010-03-25 12:05
    St Mary's Sanatorium for Severed Hands:
    Did anybody read this?
    yes, but to be fair, it was rather `tl;dr` (or `tl;<shouldn't have>r`

    Guy should just hire a secretary. <!--This actually has side benefits if he pays well enough and she's (ASSumptions) cute and it's his hands that give him fits. * --> Seriously, they can be trained to transcribe code as well as anyone can. Does he really want to see the code in realtime as he dictates it?

    Dragon Naturally Speaking not working?

    Chorded keyboard too much to ask to work one-handed?

    Perl won't suffice? (joke about all things in perl being reducable)

    There, are we happy now?

    * Yes, I know about the site BBCode and HTML inlining. You really thought I would be surprised by this? You MUST be new here.
  • drachenstern 2010-03-25 12:07
    Remy Porter:
    The issue is this: the "right" answer is tedious and boring. Bah, pour, empty, pour, empty. And it's tied to implementation- it'd be far more fun to solve the problem for any combination of containers and target volumes.
    I smell a programming praxis coming on...
  • DeepThought 2010-03-25 12:07
    Patrick:
    Does the Senior Programmer have no hands with which to type?


    Or has a sever case of carpal tunnel syndrome.
  • Matt 2010-03-25 12:08
    Not to mention the fact that that would give you 4 litres not 4 gallons and we don't know if we are dealing with US or Imperial gallons.
  • Abdiel 2010-03-25 12:08
    Fill the 747 with water, place it on a scale, fill the 5 gallon container from the 747... wait, what was the question again?
  • Matt 2010-03-25 12:09
    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.


    Not to mention the fact that that would give you 4 litres not 4 gallons and we don't know if we are dealing with US or Imperial gallons.
  • BentFranklin 2010-03-25 12:09
    Then you'd have a little over 1 gallon. UNIT WEIGHT FAIL!
  • Matt 2010-03-25 12:10
    Matt:
    Not to mention the fact that that would give you 4 litres not 4 gallons and we don't know if we are dealing with US or Imperial gallons.


    Ah! So that's what the "Quote" button does.(D'Oh)
  • Lennart 2010-03-25 12:11
    1- Weigh the 5 *whatever* bottle.
    2- Fill the 5 *whatever* bottle.
    3- Wiegh the 5 *whatever* bottle again.
    4- Divide the difference by 5.

    A universal solution for a subset of your problems!
  • alegr 2010-03-25 12:12
    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...
  • ceiswyn 2010-03-25 12:12
    And yet another alternative:

    #1 #2
    3 5
    3 0 Fill #1
    0 3 Transfer the water from #1 to #2
    3 3 Fill #1
    1 5 Fill #2 from #1
    1 0 Throw away the water in #2
    0 1 Transfer the water from #1 to #2
    3 1 Fill #1
    0 4 Voila.

    Has the advantage that the water's only ever going in one direction, too.
  • BentFranklin 2010-03-25 12:15
    If Reply isn't comment-specific, why is there one button per port?
  • SenTree 2010-03-25 12:15
    Remy Porter:
    SenTree:
    blem specified bottles which would mean the orifices are too narrow for insertion.


    Most expressions of that problem aren't that specific. Yes, in the case of bottles, that likely means the tops are too narrow. But then again, they are oddly shaped. This implies that our general assumptions about the bottles aren't safe, and that the bottleneck of the larger bottle could easily be large enough to insert a 3 gallon bottle.

    If the problem doesn't want the containers married, it should have specified it as impossible, not simply implied it.

    The issue is this: the "right" answer is tedious and boring. Bah, pour, empty, pour, empty. And it's tied to implementation- it'd be far more fun to solve the problem for any combination of containers and target volumes.

    Absolutely. And I forgot the </pedant> tag on my post - I've just been reviewing some design documents and forgot to reset my brain !
  • BentFranklin 2010-03-25 12:16
    ... per post
  • Marc B 2010-03-25 12:18
    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.


    Well played. And if they tell you that you aren't strong enough, you can challenge them to produce a 747 so that you can prove that you can indeed lift it.
  • Bluesman 2010-03-25 12:24
    Apparently there are different versions 747s:

    http://en.wikipedia.org/wiki/Boeing_747

    So next time this happens during an interview, just ask them to specify what version.
  • usitas 2010-03-25 12:24
    AndersI:
    I would put the five gallon bottle on the scale and fill water into it until it is 4 kg heavier.


    I didn't have time to read the rest of the comments, but 1 gallon doesn't weigh 1 kg. Plus we don't know if it is a US or Imperial gallon.
  • Steve The Cynic 2010-03-25 12:26
    BentFranklin:
    Then you'd have a little over 1 gallon. UNIT WEIGHT FAIL!


    Under. A gallon is ~4.6 litres.

    UNIT VOLUME FAIL!
  • Iain Collins 2010-03-25 12:30
    If someone asks for something esoteric like "I want exactly 4 gallons of water, not 3 and 5 is right out (even though I don't care if you have to waste water in the process). Oh and you have to use these specific and difficult to work with receptacles to measure the amount out, and don't use any other tools." then it would be amiss not to enquire as to why the requirements are so specific and exotic.

    This is crucial so that you can be sure your solution is suitable to their needs, because even if you created a solution that met the stated requirements, it would be irresponsible, as an informed expert, not to ask pertinent questions in cases where you think important relevant information has not been provided and there is a particular risk for the business (such as in spending an unnecessary amount of time developing an overly complex solution to a problem where the requirements can be greatly simplified, or that has been entirely misdiagnosed).

    If someone can't explain the significance of a request that odd and expect you to implement it without questioning it and without the submitter providing any rational for the request it's not a place a capable developer would is going to want to work in and would expect that the most of developers they will end up hiring are the sort who will lead them merrily straight off a cliff on the next team building exercise "because the map shows the path clearly continues here".
  • BradC 2010-03-25 12:32
    Remy Porter:
    And honestly, I'm not really certain what the "right" answer is to the 3/5 gallon problem. My answer? Put the 3 gallon container in the 5 gallon container, fill the 5 gallon container. Take the 3 gallon out, and put the two gallons you just made into the 3 gallon container. Repeat, but this time pour the 2 gallons in the 3 gallon container into the 5 gallon container.

    I like the nested container idea, but when I first read your solution, I read it as "put 5 gallons into the nested 3/5 set, filling both containers", which obviously doesn't work. You'd need to either cap the 3 gal container so it doesn't get any water in it, or make sure its opening floats exactly level with the top of the 5-gal. Either way, you're fighting the buoyancy of the container, and you're unlikely to get a really precise result.

    Also, unless the thickness of the containers is negligible, you'd get slightly less than 2 gal in the 5 gal container.

    Actually, it just occurred to me that the easiest way would be to turn the 3-gal container upside-down, and hold it to the bottom of the 5-gal container.

    Edit: but then, its hard to "repeat" that with 2 gal in the 3-gal container....
  • Kiss me I'm Polish 2010-03-25 12:32
    I hate the Boeing 747 question. It's one of those "A-ha!" questions. Either you know the correct reply, or you don't - there's no actual analysis or programming skills involved.
    I remember Joel Spolsky ranting about it, and he got that one right.
    Other "a-ha" questions I met during interviews include:
    - the depth of Thames under a bridge in London (reply: "under which one" to win),
    - the bus stop problem (you drive a small 2-person car, and you see a bus stop where 3 people gathered: a friend of yours, a woman with whom you instantly fall in love, and a dying person who needs medical attention to survive. Oh and it's raining. What do you do? There is a *right* answer, and either you know it or you lose) Here it is, smart boy: You tell the friend to drive the dying person to a hospital, while you stay at the bus stop with the hottie and start the sweet talk.
    - the woodchuck question, which is just silly.
    The water jugs problem is better, because it can be solved. It has an "a-ha" moment, when you have to stop adding numbers and think about substraction, but it's not impossible.
  • Me 2010-03-25 12:36
    Jim the Electrician:
    Apparently I'm a fast typist, because the post was still available on Craigslist when I looked.

    The odd thing is, I'm not a fast typist, and I could still find the post.

    And everyone knows you weigh a 747 by putting it in a bath and weighing the displaced water.
  • neveralull 2010-03-25 12:38
    Never heard the bus stop problem before, but it's obvious: give your car to your friend to take the dying person to a hospital, while you gallantly stay behind to keep the girl company.
  • Hans 2010-03-25 12:47
    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.


    So we have a universe consisting of two containers.

    Where do you get the water to fill the containers? The problem made no explicit mention of the presence of a tap.

  • Vic 2010-03-25 12:47
    psuedonymous:
    You cannot put four gallons into these bottles because they are odd shaped.
    Maybe he assumed that not only is water quantised, but must maintain it's odd/even state.

    Regardless, for making such a truly terrible pun he should also never have been hired.


    Perhaps it is a homeopathic principle - the water remembers the shape of one of the containers, so can't be poured into the other.
  • Anon 2010-03-25 12:47
    neveralull:
    Never heard the bus stop problem before, but it's obvious: give your car to your friend to take the dying person to a hospital, while you gallantly stay behind to keep the girl company.


    Nonsense, you run the dying person down. They are dying after all. Put them out of their misery.
  • usitas 2010-03-25 12:48
    neveralull:
    Never heard the bus stop problem before, but it's obvious: give your car to your friend to take the dying person to a hospital, while you gallantly stay behind to keep the girl company.


    Nope. Wrong.

    You call an ambulance for the dying guy, give your friend bus fare, and f*** the girl in your car.
  • Anon 2010-03-25 12:49
    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?
  • Bellinghman 2010-03-25 12:49
    Kiss me I'm Polish:
    - the bus stop problem (you drive a small 2-person car, and you see a bus stop where 3 people gathered: a friend of yours, a woman with whom you instantly fall in love, and a dying person who needs medical attention to survive. Oh and it's raining. What do you do? There is a *right* answer, and either you know it or you lose)
    This is a new one on me.

    So I'm going to guess.

    I hand the keys to my friend to drive the dying person to hospital, while I stay and hand one of the two umbrellas I keep in my car to the woman, who will be so impressed by my thoughtfulness and selflessness that she falls instantly in love with me.

    (Yes, I do carry two umbrellas in my car. You may have my MG changed from a ZT to TF, but that bit won't change.)

    (And it's such a shame that everyone's mobile phones are inoperative, since that means we can't dial for an ambulance full of trained paramedics, which is possibly better for the patient than trying to get into a two seater.)

    What? You think I'd hand my keys to the woman? No way - I may love her as no-one has loved anyone before, but I don't trust her yet.
  • Bellinghman 2010-03-25 12:52
    Hans:
    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.
    So we have a universe consisting of two containers.

    Where do you get the water to fill the containers? The problem made no explicit mention of the presence of a tap.
    You are allowed to assume certain things in these questions you know. Like the presence of air to breathe. Just not things that the original question said were not available.
  • Anon 2010-03-25 12:52
    Kiss me I'm Polish:

    - the bus stop problem (you drive a small 2-person car, and you see a bus stop where 3 people gathered: a friend of yours, a woman with whom you instantly fall in love, and a dying person who needs medical attention to survive. Oh and it's raining. What do you do? There is a *right* answer, and either you know it or you lose)


    The tell the interviewer that you are happily married and angrily demand to know what they are trying to imply by suggesting that you'd instantly fall in love with another woman. Then you sue the company for sexually harassing you by basically implying that you're a swinger in an interview.
  • Iain Collins 2010-03-25 12:54
    neveralull:
    Never heard the bus stop problem before, but it's obvious: give your car to your friend to take the dying person to a hospital, while you gallantly stay behind to keep the girl company.

    I've heard heard of that before either (and can't find any reference to it), but assumed that was the "correct" answer.

    Although - unless I knew I was near hospital, and had a good idea of how to get to it - I would stop and offer my friend a lift (given it's raining), phone an ambulance so that some professionals can attend to the dying person, and ignore the other woman as my GF wouldn't be very happy about me chatting her up.
  • Anon 2010-03-25 12:55
    Bellinghman:

    What? You think I'd hand my keys to the woman? No way - I may love her as no-one has loved anyone before, but I don't trust her yet.


    Actually, you should hand the keys to the dying person. They'll get themselves to hospital if they really want it.

    Interestingly, I think this is the GOP's health care plan.
  • charliebob 2010-03-25 12:55
    Ozz:
    anon:
    I'd find the weight of the 747 by reading the service manual.
    That's the right answer, right?
    You left the service manual in your other pants. Now what do you do?


    I'd ask my Dad who works on them...
    Or look it up on Wiki/Google...one will know :P

    Off the top of my head, I think the gross weight of an unladen B-747 is around 200 Tonnes. I could be wrong though...

    Now the airspeed velocity of an unladen swallow...THAT'S a question!!!
  • ObiWayneKenobi 2010-03-25 12:56
    The real WTF in the second story is that this "promising candidate" was presumably not even called in for an interview for failing to do some lame-ass trick puzzle question.
  • neveralull 2010-03-25 12:57
    I stand corrected
  • Anon 2010-03-25 12:59
    ObiWayneKenobi:
    The real WTF in the second story is that this "promising candidate" was presumably not even called in for an interview for failing to do some lame-ass trick puzzle question.


    The story said "the next round of interviews" so presumably this was in some stage of interviews that may have been on-site. Either way, not being able to do it is one thing, giving an answer so clearly stupid is another. I wouldn't call him in either based on that.
  • Pentium100 2010-03-25 13:00
    Me:
    ...

    And everyone knows you weigh a 747 by putting it in a bath and weighing the displaced water.


    No, you would measure the volume of the 747.

    You measure the weight of a 747 by disassembling it and weighing each part separately.
  • Remy Porter 2010-03-25 13:01
    Hans:
    The problem made no explicit mention of the presence of a tap.


    Good point. I will assume that I am in a resting state, ergo, my pulse should be, on average, constant. Begin measuring my pulse and start filling the 5 gallon container. Count the pulses.

    Repeat this trial a few times and mentally take the average. Multiply by 4/5, and that's how many pulses you'll need to fill the container to four gallons. You can keep the 3 gallon container.
  • jdw 2010-03-25 13:08
    AndersI:
    I would put the five gallon bottle on the scale and fill water into it until it is 4 kg heavier.
    Good job. You now have just over one US gallon. Also, you've broken the rules.
  • Zapp Brannigan 2010-03-25 13:10
    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?
  • Anonymous 2010-03-25 13:11
    Kiss me I'm Polish:
    - the bus stop problem (you drive a small 2-person car, and you see a bus stop where 3 people gathered: a friend of yours, a woman with whom you instantly fall in love, and a dying person who needs medical attention to survive. Oh and it's raining. What do you do? There is a *right* answer, and either you know it or you lose)

    They're already at a bus stop so why do I need to take them anywhere? I lose, don't I?
  • wcw 2010-03-25 13:14
    Igni:
    Those of you that think that job posting is bizarre have obviously never had RSI. Just sayin'.


    What's bizarre is that they expect to get a smart, capable kid who can type fast in Manhattan for $20 an hour. What that kind of money in NYC actually buys you is something else entirely, like maybe a hand job from a crack whore in Jersey.
  • D-Coder 2010-03-25 13:16
    jdw:
    AndersI:
    I would put the five gallon bottle on the scale and fill water into it until it is 4 kg heavier.
    Good job. You now have just over one US gallon. Also, you've broken the rules.


    For crying out loud.

    Just give the customer the full five-gallon container.

    The extra gallon doesn't cost you anything significant.
    You've saved the time needed to figure this out.
    You've avoided any chance of screwing up and giving the customer only three gallons.
    The customer is happy cuz he has 25% extra for free.
  • Anonymous 2010-03-25 13:20
    D-Coder:
    Just give the customer the full five-gallon container.

    The extra gallon doesn't cost you anything significant.
    You've saved the time needed to figure this out.
    You've avoided any chance of screwing up and giving the customer only three gallons.
    The customer is happy cuz he has 25% extra for free.

    You sir, are a genius. This is the absolute best answer to this problem. Everyone wins.
  • Mike 2010-03-25 13:36
    3 gallons should be enough for anyone.
  • TheAnonCoward 2010-03-25 13:40
    anon:
    I'd find the weight of the 747 by reading the service manual.

    That's the right answer, right?


    That's an RTFM win right there.
  • FuBar 2010-03-25 13:42
    Surely someone here must know the SQL statement that would calculate the weight of a 747?

  • Mike 2010-03-25 13:44
    Da' Man:
    DEFINE 5 4;


    I have a feeling that may cause another problem down the road.
  • jrh 2010-03-25 13:45
    wcw:

    What's bizarre is that they expect to get a smart, capable kid who can type fast in Manhattan for $20 an hour. What that kind of money in NYC actually buys you is something else entirely, like maybe a hand job from a crack whore in Jersey.


    Actually a hand job in Jersey isn't something you'd buy in NYC.
  • Worf 2010-03-25 13:48
    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?


    Mass balances are gravity-agnostic (well, they assume that over their span that gravity is the same, which means practically anywhere except near or in a black hole). They measure mass, not weight. Add in the mass of 4 gallons of water. Which depends on the type of gallon you're talking about...

    Now, using a scale, that depends on the local gravity.
  • Bruce 2010-03-25 13:49
    The real WTF is in the second to last paragraph:

    ...In early 2008, Braxton left Ellington Management Group, a leading mortgage trading hedge fund, where he was Head of MBS and ABS Credit Modeling...

    So this is one of the guys responsible for tanking the economy, and we think he'll be able to run a start-up?
  • Mike 2010-03-25 13:52
    FuBar:
    Surely someone here must know the SQL statement that would calculate the weight of a 747?



    SELECT WeightInPoundsAtSeaLevelOnEarth FROM tblUselessWTFAirplaneData WHERE VehicleType='Boeing747'
  • Problem Solver 2010-03-25 13:52
    How would you get four gallons of water? I'd get a four gallon container, and fill it.

    What is the height of a 747 on the runway? Call the tower, ask for the elevation of the runway. Filled with fuel? Check the tires for proper air pressure.

    Oh you mean what does the 747 weigh? Have it take off. Now it is in flight, and weightless. Answer = zero. Wait, what? Oh. Well then land it in the ocean and do something with the water. OK I'm getting confused here.

    A 747, assuming the carpets were recently vacuumed, weighs exactly 217,454 quatloms. Prove me wrong.

    Oh and you can take your puzzle job and shove it because while you and I were sitting here farting around your competition just invented facebook.
  • Mike 2010-03-25 13:55
    Bruce:
    The real WTF is in the second to last paragraph:

    ...In early 2008, Braxton left Ellington Management Group, a leading mortgage trading hedge fund, where he was Head of MBS and ABS Credit Modeling...

    So this is one of the guys responsible for tanking the economy, and we think he'll be able to run a start-up?


    How to run a successful start-up if you're a complete moron who has already destroyed the world economy:

    1) Start-up
    2) Get funding
    3) Grow
    4) Get more funding based on growth
    5) PROFIT
    6) Get out
  • Does my answer count? 2010-03-25 13:59
    Fill the three gallon bottle while counting with a steady rhythm. Multiply the result by 4/3. Fill the five gallon bottle while counting to that number. Shut off the faucet.

    Sell the four gallons to the customer while everyone else is spilling water all over themselves. Take the leftover 3 gallons with you and go collect your prize for saving Good Mother Earth by not wasting any water. Live happily ever after.
  • K 2010-03-25 14:03
    A colleague of mine with RSI once hired an "assistant programmer". Apparently it does help if they have programming experience and have typed code before.
  • shadowman 2010-03-25 14:05
    DeepThought:
    Patrick:
    Does the Senior Programmer have no hands with which to type?


    Or has a sever case of carpal tunnel syndrome.


    I think a 'sever case' is something entirely different from carpal tunnel syndrome.
  • Hatterson 2010-03-25 14:06
    Problem Solver:
    Oh you mean what does the 747 weigh? Have it take off. Now it is in flight, and weightless. Answer = zero. Wait, what? Oh. Well then land it in the ocean and do something with the water. OK I'm getting confused here.


    You're saying something in flight has no weight? Interesting. I believe your solution to the puzzle told me all I need to know
  • Hatterson 2010-03-25 14:08
    Does my answer count?:
    Fill the three gallon bottle while counting with a steady rhythm. Multiply the result by 4/3. Fill the five gallon bottle while counting to that number. Shut off the faucet.

    Sell the four gallons to the customer while everyone else is spilling water all over themselves. Take the leftover 3 gallons with you and go collect your prize for saving Good Mother Earth by not wasting any water. Live happily ever after.


    Why not simply take those 3 gallons, pour them into the 5 gallon jug and then pour for an additional 1/3 of the time?
  • usitas 2010-03-25 14:14
    Hatterson:
    Problem Solver:
    Oh you mean what does the 747 weigh? Have it take off. Now it is in flight, and weightless. Answer = zero. Wait, what? Oh. Well then land it in the ocean and do something with the water. OK I'm getting confused here.


    You're saying something in flight has no weight? Interesting. I believe your solution to the puzzle told me all I need to know


    And yet...he's right. It has everything to do with weight and nothing to do with mass.
  • Lorne Kates 2010-03-25 14:17
    jrh:
    wcw:

    What's bizarre is that they expect to get a smart, capable kid who can type fast in Manhattan for $20 an hour. What that kind of money in NYC actually buys you is something else entirely, like maybe a hand job from a crack whore in Jersey.


    Actually a hand job in Jersey isn't something you'd buy in NYC.


    ... without taking a few blue pills first.
  • agrif 2010-03-25 14:17
    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)
  • Stark 2010-03-25 14:18
    Kiss me I'm Polish:
    ...
    - the bus stop problem (you drive a small 2-person car, and you see a bus stop where 3 people gathered: a friend of yours, a woman with whom you instantly fall in love, and a dying person who needs medical attention to survive. Oh and it's raining. What do you do? There is a *right* answer, and either you know it or you lose)


    That, or you know, you have a little thing called ethics and deliver the proper answer becomes it comes naturally. I think this is a good question for business people, but not programmers.
  • WhiskeyJack 2010-03-25 14:19
    Fill 3 gallon container. Pour into 5 gallon container. Mark the half-way point of the height of the remaining air space in the 5 gallon container, fill to that level.

    Perfectly accurate if the container is perfectly cylindrical, will be a bit off if the container tapers. But you won't have wasted all that water you throw away using the "correct" solution.

    Or, bring the 3 and 5 gallon jugs to the thrift shop and trade for a 4 gallon jug.
  • Crabs 2010-03-25 14:21
    Pentium100:
    Me:
    ...

    And everyone knows you weigh a 747 by putting it in a bath and weighing the displaced water.


    No, you would measure the volume of the 747.

    You measure the weight of a 747 by disassembling it and weighing each part separately.


    Well that would take forever. I would have it take off, measure the speed it was going when it left the ground and the angle of attack of it's wings, and calculate the lift. The lifting force should be equal to the weight at that point.
  • Hatterson 2010-03-25 14:23
    usitas:
    Hatterson:
    Problem Solver:
    Oh you mean what does the 747 weigh? Have it take off. Now it is in flight, and weightless. Answer = zero. Wait, what? Oh. Well then land it in the ocean and do something with the water. OK I'm getting confused here.


    You're saying something in flight has no weight? Interesting. I believe your solution to the puzzle told me all I need to know


    And yet...he's right. It has everything to do with weight and nothing to do with mass.


    A plane in flight is no more weightless than a plane sitting on the ground. Simply because the counter force to gravity comes from aerolift produced by the wings rather than a reaction force from the ground does not mean it is weightless.

    Go do some research on 'weightless' (perhaps google can help)
  • Mike 2010-03-25 14:25
    Kiss me I'm Polish:
    I hate the Boeing 747 question. It's one of those "A-ha!" questions. Either you know the correct reply, or you don't - there's no actual analysis or programming skills involved.
    I remember Joel Spolsky ranting about it, and he got that one right.
    Other "a-ha" questions I met during interviews include:
    - the depth of Thames under a bridge in London (reply: "under which one" to win),
    - the bus stop problem (you drive a small 2-person car, and you see a bus stop where 3 people gathered: a friend of yours, a woman with whom you instantly fall in love, and a dying person who needs medical attention to survive. Oh and it's raining. What do you do? There is a *right* answer, and either you know it or you lose) Here it is, smart boy: You tell the friend to drive the dying person to a hospital, while you stay at the bus stop with the hottie and start the sweet talk.
    - the woodchuck question, which is just silly.
    The water jugs problem is better, because it can be solved. It has an "a-ha" moment, when you have to stop adding numbers and think about substraction, but it's not impossible.


    Meh, not just one right answer to me though this is probably assuming the interviewer isn't a geek...

    - Put a scale under each wheel (or gear leg anyway) and add up the weight
    - Pick it up with a hydraulic crane and measure the force necessary.
    - Use hydraulics in the landing gear and measure the pressure necessary to keep the plane level.
    - Weigh each piece and gallon of fuel as you put the 747 together.
    - Find a dam that is about ready to overflow, toss the 747 in and measure the amount of water that overflows.

    I'm sure there are a ton more :)
  • caper 2010-03-25 14:37
    Ok everyone, into the car.
  • Capt. Obvious 2010-03-25 14:40
    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?

    Given shock absorbers, height changes as a function of weight.
  • Wesha 2010-03-25 14:53
    Don't you realize? The Founder is a die hard programmer. But he has lost his vision.

    Did ANY ONE OF YOU EVER THINK how YOU will fuel your passion for computing if this ever happens to you?..

  • zelator 2010-03-25 14:58
    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?
  • Wesha 2010-03-25 15:00
    > (you drive a small 2-person car, and you see a bus stop where 3 people gathered: a friend of yours, a woman with whom you instantly fall in love, and a dying person who needs medical attention to survive. Oh and it's raining. What do you do? There is a *right* answer, and either you know it or you lose) Here it is, smart boy: You tell the friend to drive the dying person to a hospital, while you stay at the bus stop with the hottie and start the sweet talk.

    It all depends, my dear, it all depends. Your "universal" answer does not consider the possibilities:
    1) The dying person might be Hitler...
    2) I might be gay...
  • Anon 2010-03-25 15:01
    Kiss me I'm Polish:
    - the bus stop problem (you drive a small 2-person car, and you see a bus stop where 3 people gathered: a friend of yours, a woman with whom you instantly fall in love, and a dying person who needs medical attention to survive. Oh and it's raining. What do you do? There is a *right* answer, and either you know it or you lose)


    Does the car have a trunk or luggage ties on the roof?

    Kiss me I'm Polish:
    Here it is, smart boy: You tell the friend to drive the dying person to a hospital, while you stay at the bus stop with the hottie and start the sweet talk.


    Which is of course an asshole move in some ways since your friend presumably had something to do other than drive a dying guy to the hospital. Not to mention moving a dying person yourself is usually a bad thing compared to performing first aid while waiting for an ambulance. If nothing else it may very well take longer to drive to a hospital than it is to have an ambulance do it (speed limits, traffic lights, unfamiliar area, no idea where hospitals are, etc.).

    Since neither my friend nor the woman have done that yet I can assume they're both useless. So the woman may look hot but honestly if she's that useless I doubt I'd want to deal with her after ten minutes. So no, love it is not. Still might be a good lay mind you.

    Anyway. I'd have instead called an ambulance and did whatever the dispatcher said till the ambulance came. Then if I had something important to do and found the woman to be the bimbo I assume she is then I'd have just given my friend a lift. Plenty of hot bimbos in the world. If I did want to go for the woman I'd give my friend the car on the pretense that my friend was likely late and we weren't going to the same place. Then I'd wait with the woman on the bus stop, my display of trying to save the man's life while keeping the situation under control having likely increasing her view of me immensely (especially contrasted to my friend's uselessness).

    I summary I found the expected answer to have the same lack of forethought that exemplifies badly designed products.
  • Medezark 2010-03-25 15:03
    Does my answer count?:
    Fill the three gallon bottle while counting with a steady rhythm. Multiply the result by 4/3. Fill the five gallon bottle while counting to that number. Shut off the faucet.

    Sell the four gallons to the customer while everyone else is spilling water all over themselves. Take the leftover 3 gallons with you and go collect your prize for saving Good Mother Earth by not wasting any water. Live happily ever after.


    No, no, no --
    A. Fill the three gallon bottle while counting, as above. B. Divide the result by 3 (giving you the "time" for 1 gallon).
    C. Pour the three gallon bottle into the 5 gallon bottle.
    D. Add water to the 5 gallon container for the time period indicated by B.
    E. Profit

    That way, you don't have to use any scary fractions. And you don't waste any water.
  • Kef Schecter 2010-03-25 15:12
    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


    I came up with a "lateral thinking" solution, though it does require the bottles to be transparent or translucent (but the problem description implied they were):

    1. Fill the large bottle.
    2. Fill the small bottle with the large bottle. The large bottle now has two gallons.
    3. Empty the small bottle and fill it with the two gallons.
    4. Mark the two-gallon mark. If you have no marker, you can keep a finger or thumb held there to mark the place.
    5. Fill the small bottle, empty it into the big bottle (so it now has 3 gallons).
    6. Fill the small bottle again.
    7. Empty one gallon from the small bottle into the large bottle. How do you know how much is one gallon? Well, you marked the 2-gallon point, and it's a 3-gallon bottle, so the space from the marker to the top of the bottle must be one gallon.
    8. The large bottle now contains 4 gallons.

    The only problem with this solution -- assuming you're forced to use your finger or thumbs to mark the position -- is that, obviously, 3-gallon and 5-gallon containers are much too big to be held with one hand, so you may have trouble keeping the place marked accurately. I think this solution is creative enough to at least allow *some* credit, though. TIMTOWTDI. :)

    - Kef
  • Anonymous 2010-03-25 15:17
    Craigslist shouldn't count as a WTF. 99% of those job postings are asking for slave labor. I see too many of those "We're making the next Facebook" and "10 years experience with this ginourmous list of skills" for $20/hr to go and look there seriously.

    The candidates I've interviewed from job postings are also kind of a WTF also. I swear one of them was a closet skinhead.
  • FuBar 2010-03-25 15:19
    Hatterson:
    A plane in flight is no more weightless than a plane sitting on the ground. Simply because the counter force to gravity comes from aerolift produced by the wings rather than a reaction force from the ground does not mean it is weightless.

    Which leads us to another way of measuring. Fly the plane at a known velocity into an object of known elasticity and measure the resulting displacement. Calculate the mass, and hence the weight, from that.

    (hope this wasn't in bad taste)
  • RandomUser423670 2010-03-25 15:21
    Hatterson:
    usitas:
    Hatterson:
    Problem Solver:
    Oh you mean what does the 747 weigh? Have it take off. Now it is in flight, and weightless. Answer = zero. Wait, what? Oh. Well then land it in the ocean and do something with the water. OK I'm getting confused here.
    You're saying something in flight has no weight? Interesting. I believe your solution to the puzzle told me all I need to know
    And yet...he's right. It has everything to do with weight and nothing to do with mass.
    A plane in flight is no more weightless than a plane sitting on the ground. Simply because the counter force to gravity comes from aerolift produced by the wings rather than a reaction force from the ground does not mean it is weightless.

    Go do some research on 'weightless' (perhaps google can help)
    Clearly he meant for the plane to "take off" into orbit, somehow. (Yes, yes. Even then, is it really weightless? Your results may vary by physics model.)
  • Anon 2010-03-25 15:23
    Medezark:
    Does my answer count?:
    Fill the three gallon bottle while counting with a steady rhythm. Multiply the result by 4/3. Fill the five gallon bottle while counting to that number. Shut off the faucet.

    Sell the four gallons to the customer while everyone else is spilling water all over themselves. Take the leftover 3 gallons with you and go collect your prize for saving Good Mother Earth by not wasting any water. Live happily ever after.


    No, no, no --
    A. Fill the three gallon bottle while counting, as above. B. Divide the result by 3 (giving you the "time" for 1 gallon).
    C. Pour the three gallon bottle into the 5 gallon bottle.
    D. Add water to the 5 gallon container for the time period indicated by B.
    E. Profit

    That way, you don't have to use any scary fractions. And you don't waste any water.


    All these "time how long it takes to fill x" assume you can add water at a constant rate via some kind of tap or spigot. That wasn't stated in the problem. You could have a large tub of water and you need to fill the containers from that.
    Also, wasn't this puzzle from Lethal Weapon, not Die Hard? I seem to vaguely remember Danny Glover and Mel Gibson doing this and they had to fill the containers from the basin of a fountain or a bomb was going to explode.
  • Marc B 2010-03-25 15:25
    I have a 4 gallon jug at home, if you just told me ahead of time, I would have brought it to the interview.
  • Anon 2010-03-25 15:27
    Wesha:
    > (you drive a small 2-person car, and you see a bus stop where 3 people gathered: a friend of yours, a woman with whom you instantly fall in love, and a dying person who needs medical attention to survive. Oh and it's raining. What do you do? There is a *right* answer, and either you know it or you lose) Here it is, smart boy: You tell the friend to drive the dying person to a hospital, while you stay at the bus stop with the hottie and start the sweet talk.

    It all depends, my dear, it all depends. Your "universal" answer does not consider the possibilities:
    1) The dying person might be Hitler...
    2) I might be gay...


    This^. The right answer absolutely depends on your objective. The "right" answer as the OP puts it suggests that your ultimate objective is to get in the girl's pants, which isn't the moral or ethical decision. The right answer would be to take the dying person to hospital yourself because a) Your friend was waiting for the bus anyway, if you hadn't come along, they'd still be wait, so no loss on their part and b) stop thinking with your dick.
  • frits 2010-03-25 15:32
    agrif:
    ...(a pint's a pound the world around, unless you lived in civilized nations where a pound is for dogs)


    Please take your metric snobbery elsewhere. Don't you people get it? Use of Imperial Units is a trade barrier-- sorta like the CE mark.
  • Lego 2010-03-25 15:34
    jrh:
    wcw:

    What's bizarre is that they expect to get a smart, capable kid who can type fast in Manhattan for $20 an hour. What that kind of money in NYC actually buys you is something else entirely, like maybe a hand job from a crack whore in Jersey.


    Actually a hand job in Jersey isn't something you'd buy in NYC.


    This sounds like interstate commerce. Careful or the federal government may take over your business.
  • Me 2010-03-25 15:35
    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


    Fill #1 & #2.
    Empty both over your head.

    Captcha: nobis - how appropriate.
  • PeriSoft 2010-03-25 15:35
    Anon:

    This^. The right answer absolutely depends on your objective. The "right" answer as the OP puts it suggests that your ultimate objective is to get in the girl's pants, which isn't the moral or ethical decision. The right answer would be to take the dying person to hospital yourself because a) Your friend was waiting for the bus anyway, if you hadn't come along, they'd still be wait, so no loss on their part and b) stop thinking with your dick.


    I'd take the dying person to the hospital myself - I can drive much faster than any of my friends.
  • SmartArse 2010-03-25 15:38
    No mention of where we're getting the water from in the puzzle?

    I'd go down to the nearest shop and ask whether they can fill me 4 gallons of water in the 5 gallon bottle

    (isn't 5 gallon rather a lot of water to be playing around with?? I thought it was 5 litres in DH3)
  • SmartArse 2010-03-25 15:39
    SmartArse:
    No mention of where we're getting the water from in the puzzle?

    I'd go down to the nearest shop and ask whether they can fill me 4 gallons of water in the 5 gallon bottle

    (isn't 5 gallon rather a lot of water to be playing around with?? I thought it was 5 litres in DH3)


    Alternatively, fill the 5 gallon jug. We then have 4 gallons of water in there, with 1 remainder.

    (How many months have 28 days? All of them.) type thing...
  • täter 2010-03-25 15:41
    Let's hope the Senior Programmer is a benevolent dictator.
  • Anon 2010-03-25 15:42
    PeriSoft:
    Anon:

    This^. The right answer absolutely depends on your objective. The "right" answer as the OP puts it suggests that your ultimate objective is to get in the girl's pants, which isn't the moral or ethical decision. The right answer would be to take the dying person to hospital yourself because a) Your friend was waiting for the bus anyway, if you hadn't come along, they'd still be wait, so no loss on their part and b) stop thinking with your dick.


    I'd take the dying person to the hospital myself - I can drive much faster than any of my friends.


    Exactly, that and nobody drives my fucking car!!!
  • Jimbo 2010-03-25 15:45
    dkf:
    Jeff Dege:
    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.
    But you can get a 747 to sit still. Especially if you've got a BA crew…


    Time to clean the coffee off the monitor again!!!

    Gold!!
  • Quirkafleeg 2010-03-25 15:52
    Ozz:
    anon:
    I'd find the weight of the 747 by reading the service manual.
    That's the right answer, right?
    You left the service manual in your other pants. Now what do you do?
    Wonder why I put them there instead of in my other trousers.
  • Chico 2010-03-25 15:53
    Ozz:
    anon:
    I'd find the weight of the 747 by reading the service manual.
    That's the right answer, right?
    You left the service manual in your other pants. Now what do you do?


    "Hahaha...I thought this cigar was in my other coat.....Wait a minnute, this <em>is</em> my other coat!!"
  • BentFranklin 2010-03-25 15:58
    Steve The Cynic:
    BentFranklin:
    Then you'd have a little over 1 gallon. UNIT WEIGHT FAIL!


    Under. A gallon is ~4.6 litres.

    UNIT VOLUME FAIL!


    That's because a litre is less than a liter.

    Please use US metric units, thank you.
  • Raptor85 2010-03-25 15:59
    Good to know I'm not the only assembly programmer in here...
  • Blah 2010-03-25 16:00
    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...


    Not the way it's stated in the article. Given that they're quite explicit about what there isn't (no scale, no dividing line....) we can assume we have other things at our disposal (such as the fish tank). This is part of the reason why such puzzles are a bad idea (if the interviewer wants a specific answer), they need to be explicit about exactly what you can and can't do. OTOH, I think allowing people to be creative and make their own assumptions gives a good indication of the way they think, and can give more valuable feedback than simply requiring that an answer is correct (this is a major failing in the way we teach math at the moment too, BTW - google "Mathematicians Apology" for an interesting article).

    The result, though necessary is not necessarily as important as the process...
  • James 2010-03-25 16:01
    AndersI:
    I would put the five gallon bottle on the scale and fill water into it until it is 4 kg heavier.


    And you would then have 4 litres of water. That's a little less than you need, I think?
  • Anonymous 2010-03-25 16:04
    Ozz:
    anon:
    I'd find the weight of the 747 by reading the service manual.
    That's the right answer, right?
    You left the service manual in your other pants. Now what do you do?


    I'd go your mother's house and get them.

    I don't care if I didn't get the job, it'd be worth it just to use that line in an interview.
  • DaveK 2010-03-25 16:07
    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.
    So does your car's. It's called "suspension".
  • DaveK 2010-03-25 16:09
    Bellinghman:
    Kiss me I'm Polish:
    - the bus stop problem (you drive a small 2-person car, and you see a bus stop where 3 people gathered: a friend of yours, a woman with whom you instantly fall in love, and a dying person who needs medical attention to survive. Oh and it's raining. What do you do? There is a *right* answer, and either you know it or you lose)
    This is a new one on me.
    Except of course that when you hit "Quote" on that post, you got to see the answer in plain text, before you snipped it away, immediately after the last word that you left in there. So not all that new to you...

  • Quirkafleeg 2010-03-25 16:11
    BentFranklin:
    Then you'd have a little over 1 gallon. UNIT WEIGHT FAIL!
    No; you'd have a little over 7 pints.
  • DaveK 2010-03-25 16:13
    Problem Solver:
    Oh you mean what does the 747 weigh? Have it take off. Now it is in flight, and weightless. Answer = zero.
    You are now officially the worst pilot in the world of all time ever, since pretty much the most fundamental skill that any pilot needs is knowing the difference between 'flight' and 'free fall'. Remind me never to book a flight on your airline.

  • Ben 2010-03-25 16:21
    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?


    It depends where the fuel goes and how much there is.
  • Peter 2010-03-25 16:23
    Ozz:
    anon:
    I'd find the weight of the 747 by reading the service manual.
    That's the right answer, right?
    You left the service manual in your other pants. Now what do you do?


    Phone a friend
  • RogerInHawaii 2010-03-25 16:25
    Anon:
    The water question isn't even a brain teaser. Just a little proof of whether or not you read a book of brain-teasers before. Sure, a few people will solve it without knowing the answer beforehand, but probably not without wasting a lot of precious interview time doing the arithmentic in their heads.


    Perfectly said!

    I hate "brain teasers" and logic puzzles. I am absolutely terrible at them. They make my brain hurt. Yet I am an excellent software engineer. I can design and implement very complex software systems with ease. The logic and experience required for software engineering bear no relationship to those god-awful brain teasers. Interviewers and particularly HR personnel interviewers, have no clue what they're doing when they use those puzzles as an interviewing tool.
  • RogerInHawaii 2010-03-25 16:30
    I fill the 5 gallon container. I drink one gallon. 4 gallons left.
  • ollo 2010-03-25 16:32
    Me:
    And everyone knows you weigh a 747 by putting it in a bath and weighing the displaced water.


    OK, the 747 sinks, now what?
  • RogerInHawaii 2010-03-25 16:35
    Dennis:
    the UNWRITTEN assumption is that the 4 gallons has to end up in the 5-gallon container.


    But what if the 4 gallons has to end up in the THREE gallon container!? Now THERE's a puzzle!
  • FuBar 2010-03-25 16:35
    Wesha:
    1) The dying person might be Hitler
    You're just tempting us with Godwin's Law, aren't you. So close, but yet so far.
  • RogerInHawaii 2010-03-25 16:42
    DeepThought:

    Or has a sever case of carpal tunnel syndrome.


    Wow, poor guy. The carpal tunnel was so bad he had to chop off his hand!
  • drachenstern 2010-03-25 16:42
    Kef Schecter:
    I came up with a "lateral thinking" solution, though it does require the bottles to be transparent or translucent (but the problem description implied they were):
    0. Get a Sharpie
    0b. Fill the small bottle and empty it into the large bottle.
    1b. Label the large bucket with a line and mark the three gallon line. Empty the large bottle.

    1. Fill the large bottle.
    2. Fill the small bottle with the large bottle. The large bottle now has two gallons.
    2b. Mark the large bottle with the Sharpie. Label the line 2.

    3. Empty the small bottle and fill it with the two gallons.
    4. Mark the two-gallon mark on this bucket as well.
    4b. Label this line 2 as well.

    5. Fill the small bottle, empty it into the big bottle (so it now has 3 gallons).
    6. Fill the small bottle again.
    6b. Empty the small bottle into the large bottle again. The large bottle, being full, has 5 gallons of the six. The small bottle now has 1 gallon. Mark the smaller bottle to know where 1 gallon is. Label that line as 1.
    6c. Now pour out all the water from both buckets, use the small bucket to finish labeling the larger bucket with 1 and four gallon marks for future reference.

    Now nobody else will ever struggle with having to remember how to get 4 gallons in the large bucket.




    QED
  • moz 2010-03-25 16:43
    charliebob:
    Off the top of my head, I think the gross weight of an unladen B-747 is around 200 Tonnes. I could be wrong though...

    Perhaps an unladen one is. Unfortunately, some muppet has filled this one with water while trying to drown it in a lake.

    I'd just drive it to a weighbridge, myself.

    As for the water problem, I can think of two ways of doing it.

    1. Put the two empty bottles on the scales mentioned in the problem, and fill one side or the other with water until they balance. Fill the larger bottle with water. Fill the smaller bottle with the larger bottle. If the smaller bottle was heavier when empty, pour the water out of it, pour the water from the larger bottle into it and refill it. If not, do nothing.

    Then make a small hole near the top of whichever bottle isn't sitting in a pool of water, taking care that any debris falls on the scale. Wait for the water to stop running out and dry that side of the scales off. Repeat until the scales balance. You now have four gallons of water split between the two bottles, and you may or may not have a usable five gallon bottle to put them in.

    2. Fill the smaller bottle almost to the brim. Put a thermometer in it and carefully note the temperature. Fill the bottle to the top. Put the bottle in a cryogenic freezer. Take it out again when the water reaches 4 gallons. You may or may not be able to fit this water in the five gallon bottle.
  • drachenstern 2010-03-25 16:44
    Anon:
    Also, wasn't this puzzle from Lethal Weapon, not Die Hard? I seem to vaguely remember Danny Glover and Mel Gibson doing this and they had to fill the containers from the basin of a fountain or a bomb was going to explode.
    No, it was Die Hard 2, this was between the cab ride and the ballpark clue.
  • James 2010-03-25 16:47
    BentFranklin:
    ... per post


    'Reply' = there will be a little thing in top right corner that says 'In reply to <link>'

    'Quote' = 'Reply' + include OP's post
  • Anon 2010-03-25 16:49
    drachenstern:
    Anon:
    Also, wasn't this puzzle from Lethal Weapon, not Die Hard? I seem to vaguely remember Danny Glover and Mel Gibson doing this and they had to fill the containers from the basin of a fountain or a bomb was going to explode.
    No, it was Die Hard 2, this was between the cab ride and the ballpark clue.


    Ok, that sounds right. I remember them rushing all around the city solving stupid puzzles. The bad guy must have been an HR person.
  • Darren 2010-03-25 16:51
    BradC:
    Remy Porter:
    And honestly, I'm not really certain what the "right" answer is to the 3/5 gallon problem. My answer? Put the 3 gallon container in the 5 gallon container, fill the 5 gallon container. Take the 3 gallon out, and put the two gallons you just made into the 3 gallon container. Repeat, but this time pour the 2 gallons in the 3 gallon container into the 5 gallon container.

    I like the nested container idea, but when I first read your solution, I read it as "put 5 gallons into the nested 3/5 set, filling both containers", which obviously doesn't work. You'd need to either cap the 3 gal container so it doesn't get any water in it, or make sure its opening floats exactly level with the top of the 5-gal. Either way, you're fighting the buoyancy of the container, and you're unlikely to get a really precise result.

    Also, unless the thickness of the containers is negligible, you'd get slightly less than 2 gal in the 5 gal container.

    Actually, it just occurred to me that the easiest way would be to turn the 3-gal container upside-down, and hold it to the bottom of the 5-gal container.

    Edit: but then, its hard to "repeat" that with 2 gal in the 3-gal container....


    It wouldn't matter if the 3 gallon one was full or filled in the process (although you might find a little is wasted as you remove it)
  • Darren 2010-03-25 16:52
    Darren:
    BradC:
    Remy Porter:
    And honestly, I'm not really certain what the "right" answer is to the 3/5 gallon problem. My answer? Put the 3 gallon container in the 5 gallon container, fill the 5 gallon container. Take the 3 gallon out, and put the two gallons you just made into the 3 gallon container. Repeat, but this time pour the 2 gallons in the 3 gallon container into the 5 gallon container.

    I like the nested container idea, but when I first read your solution, I read it as "put 5 gallons into the nested 3/5 set, filling both containers", which obviously doesn't work. You'd need to either cap the 3 gal container so it doesn't get any water in it, or make sure its opening floats exactly level with the top of the 5-gal. Either way, you're fighting the buoyancy of the container, and you're unlikely to get a really precise result.

    Also, unless the thickness of the containers is negligible, you'd get slightly less than 2 gal in the 5 gal container.

    Actually, it just occurred to me that the easiest way would be to turn the 3-gal container upside-down, and hold it to the bottom of the 5-gal container.

    Edit: but then, its hard to "repeat" that with 2 gal in the 3-gal container....


    It wouldn't matter if the 3 gallon one was full or filled in the process (although you might find a little is wasted as you remove it)

    OOPS - second time round that could be a problem....
  • RogerInHawaii 2010-03-25 16:53
    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.
  • Belle 2010-03-25 16:55
    drachenstern:
    Anon:
    Also, wasn't this puzzle from Lethal Weapon, not Die Hard? I seem to vaguely remember Danny Glover and Mel Gibson doing this and they had to fill the containers from the basin of a fountain or a bomb was going to explode.
    No, it was Die Hard 2, this was between the cab ride and the ballpark clue.


    Die Hard 3, actually. With Bruce Willis (of course) and Samuel L. Jackson.
  • Anon 2010-03-25 16:56
    RogerInHawaii:
    Anon:
    The water question isn't even a brain teaser. Just a little proof of whether or not you read a book of brain-teasers before. Sure, a few people will solve it without knowing the answer beforehand, but probably not without wasting a lot of precious interview time doing the arithmentic in their heads.


    Perfectly said!

    I hate "brain teasers" and logic puzzles. I am absolutely terrible at them. They make my brain hurt. Yet I am an excellent software engineer. I can design and implement very complex software systems with ease. The logic and experience required for software engineering bear no relationship to those god-awful brain teasers. Interviewers and particularly HR personnel interviewers, have no clue what they're doing when they use those puzzles as an interviewing tool.


    It depends on how you use them. If you give a "brain teaser" and expect the interviewee to come back with the right answer and if they don't you take that as a mark against them, then that is, frankly, retarded.
    If on the other hand, you give the "brain teaser" as a chance to see how the person thinks, see how they respond to an abstract problem, see what questions they ask. Then I think it's a valid thing to do. Take some of the non-answers on this thread. Some, I think, are good and show real intellect. Some are deliberately obtuse attempts to cheat and redefine the problem or else be a smart ass.
    I think the weight the jumbo jet problems actually might be better. Since you probably don't have the real answer, the question is more about the process and you should probably have multiple answers from a good candidate.
  • Anonymous coward 2010-03-25 17:00

    Done.
  • Anon 2010-03-25 17:01
    Belle:
    drachenstern:
    Anon:
    Also, wasn't this puzzle from Lethal Weapon, not Die Hard? I seem to vaguely remember Danny Glover and Mel Gibson doing this and they had to fill the containers from the basin of a fountain or a bomb was going to explode.
    No, it was Die Hard 2, this was between the cab ride and the ballpark clue.


    Die Hard 3, actually. With Bruce Willis (of course) and Samuel L. Jackson.


    White guy and a black guy, makes sense.
    Oddly enough according to imdb (http://www.imdb.com/title/tt0112864/trivia) Die Hard: With a Vengeance was originally consider as a sequel to Lethal Weapon.
  • doo is 2010-03-25 17:14
    drachenstern:
    Kef Schecter:
    I came up with a "lateral thinking" solution, though it does require the bottles to be transparent or translucent (but the problem description implied they were):
    0. Get a Sharpie
    0b. Fill the small bottle and empty it into the large bottle.
    1b. Label the large bucket with a line and mark the three gallon line. Empty the large bottle.

    1. Fill the large bottle.
    2. Fill the small bottle with the large bottle. The large bottle now has two gallons.
    2b. Mark the large bottle with the Sharpie. Label the line 2.

    3. Empty the small bottle and fill it with the two gallons.
    4. Mark the two-gallon mark on this bucket as well.
    4b. Label this line 2 as well.

    5. Fill the small bottle, empty it into the big bottle (so it now has 3 gallons).
    6. Fill the small bottle again.
    6b. Empty the small bottle into the large bottle again. The large bottle, being full, has 5 gallons of the six. The small bottle now has 1 gallon. Mark the smaller bottle to know where 1 gallon is. Label that line as 1.
    6c. Now pour out all the water from both buckets, use the small bucket to finish labeling the larger bucket with 1 and four gallon marks for future reference.

    Now nobody else will ever struggle with having to remember how to get 4 gallons in the large bucket.




    QED


    1. Fill both bottles.
    2. Interpolate.
  • cod3rgirl 2010-03-25 17:15
    Patrick:
    Does the Senior Programmer have no hands with which to type? That would certainly explain the need to dictate to a typist, and a typist who actually understands the code enough to not cause frustration in debugging and formatting.

    actually, my first thought when i read this was that mr. senior programmer was disabled somehow, and couldn't type well. either that, or he's such a germophobe that he won't touch keyboards...
  • RandomUser423670 2010-03-25 17:17
    Wesha:
    Don't you realize? The Founder is a die hard programmer. But he has lost his vision.

    Did ANY ONE OF YOU EVER THINK how YOU will fuel your passion for computing if this ever happens to you?..
    The same way one programmer I've met did. Braille "display" and touch-typing.
  • A/C? si 2010-03-25 17:22
    Belle:
    drachenstern:
    Anon:
    Also, wasn't this puzzle from Lethal Weapon, not Die Hard? I seem to vaguely remember Danny Glover and Mel Gibson doing this and they had to fill the containers from the basin of a fountain or a bomb was going to explode.
    No, it was Die Hard 2, this was between the cab ride and the ballpark clue.


    Die Hard 3, actually. With Bruce Willis (of course) and Samuel L. Jackson.

    You fool!
    It was clearly Die Hard 1, between the dead guy falling on the police car and Professor Snape blowing up the roof.
  • Xantor 2010-03-25 17:24
    AndersI:
    I would put the five gallon bottle on the scale and fill water into it until it is 4 kg heavier.


    Isn't that how they lost a Mars probe?
  • Devil's Advocate 2010-03-25 17:25
    RogerInHawaii:
    Anon:
    The water question isn't even a brain teaser. Just a little proof of whether or not you read a book of brain-teasers before. Sure, a few people will solve it without knowing the answer beforehand, but probably not without wasting a lot of precious interview time doing the arithmentic in their heads.


    Perfectly said!

    I hate "brain teasers" and logic puzzles. I am absolutely terrible at them. They make my brain hurt. Yet I am an excellent software engineer. I can design and implement very complex software systems with ease. The logic and experience required for software engineering bear no relationship to those god-awful brain teasers. Interviewers and particularly HR personnel interviewers, have no clue what they're doing when they use those puzzles as an interviewing tool.


    The bit in bold is exactly the problem. Too many people implement overly complex solutions (admittedly with ease). Some of the discussion seen here on the water problem illustrates that there can be more than 1 approach to a solution. Jumping headfirst into the most complex is not necessarily a good thing.

    That said, I agree, for the most part brain teasers are a crock because they put someone who has come across them before at an advantage (not to mention, someone who has come across them before probably enjoys them and so does them all the time). Similarly, someone who often sits IQ tests will appear to have a higher IQ than someone sitting one for the first time. Neither is a measure of your ability to think...
  • Sergeant Schultz 2010-03-25 17:26
    FuBar:
    Wesha:
    1) The dying person might be Hitler
    You're just tempting us with Godwin's Law, aren't you. So close, but yet so far.


    Isn't Hitler dead already?
  • Bruce 2010-03-25 17:28
    drachenstern:
    Anon:
    Also, wasn't this puzzle from Lethal Weapon, not Die Hard? I seem to vaguely remember Danny Glover and Mel Gibson doing this and they had to fill the containers from the basin of a fountain or a bomb was going to explode.
    No, it was Die Hard 2, this was between the cab ride and the ballpark clue.


    I thought it was Die Hard 3 (Die Hard with a Vegetable)
  • Mr Digby 2010-03-25 17:31
    It's obvious noone here likes salesmen.....
    I would've thought the most obvious would be:

    1) Fill both bottles (so you have a combined total of 8 2) gallons).
    2) Get your sales team to convince the customer that they need twice as much water.
  • msntfs 2010-03-25 17:35
    So is it only me or the first-guess answer is:(#1=3 gallons #2 = 5 gallons)
    fill #2
    pour #2 to #1 until it is full
    2 gallons left in #2, note the water leve(or hold your finger there, make a mark, whatever)
    empty #1
    pour all #2 to #1
    fill #2 up to the mark(2 gallons)
    pour #1 in #2

    Odd shaped container does not prevent you from marking water level.
  • Wag 2010-03-25 18:21
    Sergeant Schultz:
    Isn't Hitler dead already?

    That's what They want you to believe!
  • N 2010-03-25 18:23
    Duh
  • Xythar 2010-03-25 18:29
    The comments on this article have convinced me that it's easier to complain than do *anything*, even solve an incredibly easy mental puzzle.
  • drachenstern 2010-03-25 18:37
    Belle:
    drachenstern:
    No, it was Die Hard 2, this was between the cab ride and the ballpark clue.
    Die Hard 3, actually. With Bruce Willis (of course) and Samuel L. Jackson.
    My apologies, I should've known better than to make that gaff. Two was in the airport. Those two DO like to do movies together don't they?
  • Herby 2010-03-25 18:38
    Well, one way would be to fill up a 757 empty it into a 737. Then empty the 757 into the 737, and fill it up again and fill up the 737, you would get a 747's weight. Wouldn't that work??

    I really like the best solution:
    Go to Detroit and fill up the 5 gallon jug, drive over to Winsor (they have a tunnel!), and you have 4 gallons. Works for me! Of course, I like to travel as well.
  • drachenstern 2010-03-25 18:42
    Anon:
    I think the weight the jumbo jet problems actually might be better. Since you probably don't have the real answer, the question is more about the process and you should probably have multiple answers from a good candidate.
    Unless like me you happen to know two companies that sell plane weighing equipment (if you disassemble one side too quickly you cause problems, you have to keep the thing in check - mostly for reassembly purposes - "where's that stubby screwdriver? I just had it" is not permitted). Then you can go into details about the methods, the components being used, the cost of a system to do the measuring, the accuracy, the locations of appropriate weighing points, the structural integrity.... oh, my bad. Rambling aren't I?

    But seriously, the former employer sold just such a system. I too wondered why at first. Then I quickly lost care in the why, as I never did anything more with it than pitch in a hand moving stuff around the warehouse.

    As for the true weight, as others have said, that depends on a number of factors. Want me to place a call? Should I call the pilots I know that fly for Delta, should I call my friends at the aerospace plants, or should I call my google-buddy?
  • Jackie 2010-03-25 18:44
    drachenstern:
    Belle:
    drachenstern:
    No, it was Die Hard 2, this was between the cab ride and the ballpark clue.
    Die Hard 3, actually. With Bruce Willis (of course) and Samuel L. Jackson.
    My apologies, I should've known better than to make that gaff. Two was in the airport. Those two DO like to do movies together don't they?


    #2 was in an airport measuring the weight of 747's not 3 & 5 Gallon containers...
  • StychoKiller 2010-03-25 18:56
    Peter:
    Ozz:
    anon:
    I'd find the weight of the 747 by reading the service manual.
    That's the right answer, right?
    You left the service manual in your other pants. Now what do you do?


    Phone a friend

    Is that your "Final Answer?"
  • Franz Kafka 2010-03-25 18:56
    leave it to a wharton alum to try and hire a programmer in manhattan for $20/hr. That's probably what baggers make.
  • Mike 2010-03-25 19:15
    ollo:
    Me:
    And everyone knows you weigh a 747 by putting it in a bath and weighing the displaced water.


    OK, the 747 sinks, now what?


    It can sink all it wants... it still displaces the same amount of water.
  • Anon 2010-03-25 19:22
    Mike:
    ollo:
    Me:
    And everyone knows you weigh a 747 by putting it in a bath and weighing the displaced water.


    OK, the 747 sinks, now what?


    It can sink all it wants... it still displaces the same amount of water.


    And it still gives you the volume, not the mass.
  • wjr 2010-03-25 19:33
    PeriSoft:
    You can, however, empty and fill the bottles with water as many ties as you want. How would you get four gallons of water?

    Wait - can you fill the bottles with water, or with ties? Where do you even get enough ties to fill a 5-gallon bottle? Are we talking neckties, bow ties, or tie fighters?

    This is very confusing.
    What do you do in case of a tie?
  • drachenstern 2010-03-25 19:41
    wjr:
    PeriSoft:
    This is very confusing.
    What do you do in case of a tie?
    depends - is it attached to the plane that everyone is insistent on sinking? If so, I would cut the tie off or remove it in some fashion.

    Otherwise, probably just make sure the knot is a proper Windsor and wear it not-so-tight-that-you-choke-or-have-veins-bulging-out (English needs long compound words)
  • Pbutting Gas in Clbutt 2010-03-25 20:00
    Anonymous:
    Ozz:
    anon:
    I'd find the weight of the 747 by reading the service manual.
    That's the right answer, right?
    You left the service manual in your other pants. Now what do you do?


    I'd go your mother's house and get them.


    WIN
  • synp 2010-03-25 20:09
    neveralull:
    When we interview candidates, we feel that everthing listed on the resume is an invitation for us to ask technical questions about, but we don't necessarily hold it against the candidate if he admits that he is weak in a certain area. But my candidate got mad and started yelling at me becuase I was asking too many technical questions. He said he was strong in C++, so one of my questions was for him to give an example of when he would use a template. "I would never use a template," he said with a raised voice. I asked why, and he answered because he doesn't know anything about templates. An honest answer, but I didn't like his attitude. Other interviewers at the company liked him, for what reasons I have no idea.


    Anyone who doesn't use templates is fine by me.
  • Blern 2010-03-25 20:14
    This would be the most amount of comments I've seen for a while.

    Has TDWTF finally got their software fixed up so people can actually post first time, every time
  • DaveK 2010-03-25 20:18
    Anon:
    Mike:
    ollo:
    Me:
    And everyone knows you weigh a 747 by putting it in a bath and weighing the displaced water.


    OK, the 747 sinks, now what?


    It can sink all it wants... it still displaces the same amount of water.


    And it still gives you the volume, not the mass.
    So? That's hardly an insoluble problem: just multiply by the density.

    Of course, the best way to weigh a 747 is to put it inside a calorimeter, and burn it.

  • Some Guy 2010-03-25 20:21
    Dennis:
    That's 4 gallons in the fishtank. Of course it's wrong because the UNWRITTEN assumption is that the 4 gallons has to end up in the 5-gallon container.

    At last!

    We have determined why this is a perfect question!

    If you are a programmer, your job is to turn specifications (aka customer requirements) into code. These will *always* and without exception have an "UNWRITTEN assumption".

    A fucktard will jump up and down screaming and howling that the business analyst had "unwritten" assumptions and other vagueness.

    A competent developer, on the other hand, will apply his/her advanced mastery of the "talking to humans" skill, and work it out, possibly asking for clarification, and interpreting the clarification.

    In the case of this question, the reply "just answer the question" would suggest to a sane and intelligent person that mindless pedantry is not the correct answer. A person who is emotionally incapable of coping with that reply would instantly be filed under "less useful than a cabbage" and not hired.

    Every last fucking time this topic comes up, thousands of morons proudly explain that the question is less than perfectly specified. They are, of course, correct - and if I was doing the interview, their outrage would be the thing that persuade me that I'ld rather hire a rubby ducky.

    As a backup option, failure to answer a question when the question is discussed every last time that job interviews are discussed is not a sign that you've done your homework. Interviews always suck. That's a fact. And they are necessary. So if your interviewing skills are weak and you need to succeed in an interview, you need to do something about it. If your attitude is "I hate this bit of the process, I expect everyone else to treat me like a special snowflake" then any interviewer is going to be making assumptions about your attitude towarsd every part of the actual job that isn't fun.


    tl;dr: Just answer the god damned question, unless you have some diagnosed mental disorder, in which case I'm sorry but you may have trouble in the real world.
  • Oogie Boogie 2010-03-25 20:39
    Some Guy:
    Dennis:
    That's 4 gallons in the fishtank. Of course it's wrong because the UNWRITTEN assumption is that the 4 gallons has to end up in the 5-gallon container.

    <snip some ranting>.

    Interviews always suck. That's a fact. And they are necessary. So if your interviewing skills are weak and you need to succeed in an interview, you need to do something about it.

    <snip/censor some more>


    I'm not convinced interviews are really all that necessary. Perhaps another alternative should be considered.

    I work with a lot of muppets who got through rounds of interviewing. I know of several very capable (and reasonably skilled) people, who struggle at interview and some have missed jobs as a result.

    Interviews are necessary? Not at all!! But unfortunately, noone has yet agreed to use a better option. Interviews rarely get the best candidate - or if they do, I'm frightened to think that (some of) the people that surround me must at some time have been the best candidate.

    Incidently, it seems to me you are a very angry person. How do you cope with interviews?
  • Oogie Boogie 2010-03-25 20:43
    Oogie Boogie:
    Some Guy:
    Dennis:
    That's 4 gallons in the fishtank. Of course it's wrong because the UNWRITTEN assumption is that the 4 gallons has to end up in the 5-gallon container.

    <snip some ranting>.

    Interviews always suck. That's a fact. And they are necessary. So if your interviewing skills are weak and you need to succeed in an interview, you need to do something about it.

    <snip/censor some more>


    I'm not convinced interviews are really all that necessary. Perhaps another alternative should be considered.

    I work with a lot of muppets who got through rounds of interviewing. I know of several very capable (and reasonably skilled) people, who struggle at interview and some have missed jobs as a result.

    Interviews are necessary? Not at all!! But unfortunately, noone has yet agreed to use a better option. Interviews rarely get the best candidate - or if they do, I'm frightened to think that (some of) the people that surround me must at some time have been the best candidate.

    Incidently, it seems to me you are a very angry person. How do you cope with interviews?


    In fact, perhaps your post is a very good example.

    Many recruiters think that 'passionate people' are good people to hire. I think too often people who are passionate get all steamed up about being challenged that the lose sight of where they are going (and too often refuse to even consider that opinions other than their own may have some merit). I'm guessing you're probably someone who works with c++ who can't accept that some people prefer things done in java.
  • Franz Kafka 2010-03-25 20:49
    Anon:
    Mike:
    ollo:
    Me:
    And everyone knows you weigh a 747 by putting it in a bath and weighing the displaced water.


    OK, the 747 sinks, now what?


    It can sink all it wants... it still displaces the same amount of water.


    And it still gives you the volume, not the mass.


    So what? Take the volume of water displaced and unit convert it to mass based on the density of whatever you dunked it in. Just don't expect to do anything with the 747 after.
  • Cheong 2010-03-25 21:25
    Wow... typing speed for a programmer? That's a rare requirement...

    I guess I'm gonna fail on this one.
  • Cheong 2010-03-25 21:31
    On a second thought, this could also be happened...

    A smart programming guru somehow become handicapped and cannot use keyboard to code himself, so the company has to hire someone who "can understand what he said" and "can type fast" to type in the code for hime.
  • RogerInHawaii 2010-03-25 21:58
    Anon:
    RogerInHawaii:
    Anon:
    The water question isn't even a brain teaser. Just a little proof of whether or not you read a book of brain-teasers before. Sure, a few people will solve it without knowing the answer beforehand, but probably not without wasting a lot of precious interview time doing the arithmentic in their heads.


    Perfectly said!

    I hate "brain teasers" and logic puzzles. I am absolutely terrible at them. They make my brain hurt. Yet I am an excellent software engineer. I can design and implement very complex software systems with ease. The logic and experience required for software engineering bear no relationship to those god-awful brain teasers. Interviewers and particularly HR personnel interviewers, have no clue what they're doing when they use those puzzles as an interviewing tool.


    It depends on how you use them. If you give a "brain teaser" and expect the interviewee to come back with the right answer and if they don't you take that as a mark against them, then that is, frankly, retarded.
    If on the other hand, you give the "brain teaser" as a chance to see how the person thinks, see how they respond to an abstract problem, see what questions they ask. Then I think it's a valid thing to do. Take some of the non-answers on this thread. Some, I think, are good and show real intellect. Some are deliberately obtuse attempts to cheat and redefine the problem or else be a smart ass.
    I think the weight the jumbo jet problems actually might be better. Since you probably don't have the real answer, the question is more about the process and you should probably have multiple answers from a good candidate.


    Except that people have different ways of addressing problems. I usually take time to think things through, quietly, in my head, considering various alternatives and trying "though experiments" in my mind. If I'm forced to verbalize my train of thought it totally screws up the thought process. So I would probably fail an interview test like this, even though I might be perfectly suited to addressing their actual engineering needs.
  • RogerInHawaii 2010-03-25 22:04
    Devil's Advocate:
    RogerInHawaii:
    Anon:
    The water question isn't even a brain teaser. Just a little proof of whether or not you read a book of brain-teasers before. Sure, a few people will solve it without knowing the answer beforehand, but probably not without wasting a lot of precious interview time doing the arithmentic in their heads.


    Perfectly said!

    I hate "brain teasers" and logic puzzles. I am absolutely terrible at them. They make my brain hurt. Yet I am an excellent software engineer. I can design and implement very complex software systems with ease. The logic and experience required for software engineering bear no relationship to those god-awful brain teasers. Interviewers and particularly HR personnel interviewers, have no clue what they're doing when they use those puzzles as an interviewing tool.


    The bit in bold is exactly the problem. Too many people implement overly complex solutions (admittedly with ease). Some of the discussion seen here on the water problem illustrates that there can be more than 1 approach to a solution. Jumping headfirst into the most complex is not necessarily a good thing.

    That said, I agree, for the most part brain teasers are a crock because they put someone who has come across them before at an advantage (not to mention, someone who has come across them before probably enjoys them and so does them all the time). Similarly, someone who often sits IQ tests will appear to have a higher IQ than someone sitting one for the first time. Neither is a measure of your ability to think...


    OK, let me rephrase that sentence: "I can design and implement solutions to very complex software problems." I did not intend to imply that the solutions themselves were complex. They may be complex solutions, they may be simple solutions. But they are appropriate and properly designed.
  • P.M.Lawrence 2010-03-25 22:14
    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".
  • P.M.Lawrence 2010-03-25 22:17
    frits:
    agrif:
    ...(a pint's a pound the world around, unless you lived in civilized nations where a pound is for dogs)


    Please take your metric snobbery elsewhere. Don't you people get it? Use of Imperial Units is a trade barrier-- sorta like the CE mark.


    Those weren't imperial measures, but the short changing US variety.
  • RogerInHawaii 2010-03-25 22:18
    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?
  • P.M.Lawrence 2010-03-25 22:22
    Xantor:
    AndersI:
    I would put the five gallon bottle on the scale and fill water into it until it is 4 kg heavier.


    Isn't that how they lost a Mars probe?


    Something like that happened with the Gimli Glider, an airliner that was forced to do an unpowered emergency landing at Gimli after gliding there because it hadn't been given enough fuel.
  • xplayerhaterx 2010-03-26 00:38
    I've seen a few solutions to the water problem that ... I don't quite comprehend.

    Two scenarios: 1) Only ONE JUG can have 4 gallons. or 2) 4 gallons between either is acceptible.

    For scenario 1:

    #1 is 3 gallon (empty)
    #2 is 5 gallon (empty).

    Fill #1, dump into #2.
    Fill #1, dump into #2. At this point, #2 lacks room for the remainder liquid of #1, which means #1 has roughly 1 gallon.

    Mark that on the #1 container, empty #2, and fill into #2 one gallon at a time. #2 will have 4 gallons in it.

    For scenario 2.

    #1 is 3 gal, (empty).
    #2 is 5 gal, (empty).

    Fill #2, pour into #1 to the top. What remains in #2 is 2 gallons. Mark that point on the jug.

    Empty #1, and pour the 2 gallons of #2 into #1. Fill #2 until the marked spot. Now both jugs contain a combined 4 gallons.

    You can combine #1 into #2 and make jug #2 have 4 gallons.
  • Xythar 2010-03-26 01:00
    xplayerhaterx:
    I've seen a few solutions to the water problem that ... I don't quite comprehend.

    Two scenarios: 1) Only ONE JUG can have 4 gallons. or 2) 4 gallons between either is acceptible.

    For scenario 1:

    #1 is 3 gallon (empty)
    #2 is 5 gallon (empty).

    Fill #1, dump into #2.
    Fill #1, dump into #2. At this point, #2 lacks room for the remainder liquid of #1, which means #1 has roughly 1 gallon.

    Mark that on the #1 container, empty #2, and fill into #2 one gallon at a time. #2 will have 4 gallons in it.


    I'm not sure why you'd need to mark anything given that you can just pour the 1 gallon from #1 into #2, then fill #1 completely and pour it into #2 (which has 1 gallon in it from just before). 3+1=4, and this works for both solutions.

    I don't really see why the solution needs to be overcomplicated.
  • Dave 2010-03-26 01:36
    I'd fill the 3 gallon container and state that a 4 gallon patch is currently under development.
  • programron 2010-03-26 01:51
    Dan:
    Or severe carpal tunnel syndrome


    I actually paid someone to type my code out for me after breaking my wrists. True story! I would seriously consider doing it again if I ever lose use of my hands permanently.
  • fumjoisey 2010-03-26 02:15
    jrh:
    wcw:

    What's bizarre is that they expect to get a smart, capable kid who can type fast in Manhattan for $20 an hour. What that kind of money in NYC actually buys you is something else entirely, like maybe a hand job from a crack whore in Jersey.


    Actually a hand job in Jersey isn't something you'd buy in NYC.


    Unless the crack whore has really long arms.
  • The Web is the Root of All Info 2010-03-26 02:42
    From 'Why Should I Hire You?' and Other Favorite Interview Questions at Computerworld, this quote:

    Why should I hire you? "It's the opportunity to see if the individual wants the job," says Sherry Aaholm, executive vice president of IT at Memphis-based FedEx Corp. "I want to see if they're passionate and if they've done their research into that position."
    One interviewee gave a classic wrong answer: "Because you already know me." A previous relationship won't get a candidate the job, Aaholm says, nor will such an uninspired answer.


    This is the classic 'passion person' question, and it's a classic mistake by the interviewer.

    Short answer? "I don't know, I can't read your mind."

    The real answer (that I came up with only after reading the Computerworld article)? Whip out your copy of the skill-match cover letter you created for the position, and tell them your fit and interest in the position, and how you would like to be at that particular company.

    Me? My personal experience? All the jobs I have had in the past have been where I or the company have been desperate for a job/filled position. So when I was actually asked this question for once during an interview, my answer was "because your company's desperate." (I'm thinking: I don't know what your company's exact internal hiring process is, don't you?? [Can I put this interview by Paula Bean's relative on the DailyWTF?])

    In the quote above, the 'classic wrong answer' the person gave, "Because you already know me.", could also be counted as referring to the hiring process itself, instead on of the position. In my case, I could have given the same type of classic 'wrong' answer (very similar to the person's answer), as I was interviewing in a different part of the same company I was currently working at, trying to get into a 'career' track. So my 'already knew me' classic wrong answer would be: 'I am already in the internal systems, no need to wait a month for every thing to be setup, we can get started on the project immediately'.

    If you ask this question, and you get an answer that really doesn't connect to the specifics of the position or your company, the interviewee doesn't get the question.

    On the classic logic puzzles: My solution to working these problems is to spout out my assumptions while working on the problem, the interviewer should(!) be listening to you speak, and can correct your assumptions while still working on the problem. In my case, one time the interviewer corrected me, and he said he was looking for the basics of the answer, and not a full implementation.
  • Iago 2010-03-26 05:26
    Anon:
    The water question isn't even a brain teaser. Just a little proof of whether or not you read a book of brain-teasers before. Sure, a few people will solve it without knowing the answer beforehand, but probably not without wasting a lot of precious interview time doing the arithmentic in their heads.

    I'd never seen that one before. Presumably it's because I don't read books of brain teasers and didn't go to school in America or wherever this stuff is supposed to be common.

    It took, oh, about 30 seconds to come up with the right answer? And you reckon only "a few" people, INTERVIEWING FOR PROGRAMMING JOBS, could solve it at all?

    In that case it's a great kind of problem, because it's going to filter out all the people who have no business whatsoever trying to write code.

    Seriously, if you think it's difficult to add and subtract tiny integers in your head, please stop programming immediately. Maybe you should go work at Walmart ... no, wait, you'd never manage to give correct change.
  • Paul 2010-03-26 05:34
    ollo:
    Me:
    And everyone knows you weigh a 747 by putting it in a bath and weighing the displaced water.


    OK, the 747 sinks, now what?

    Put gaffer tape over all the seams & vents. THEN put it in the bath.

    A water-tight 747 will float. If it floats the displacement tells you the mass.

    (Is this one for the Mythbusters?)
  • Kempeth 2010-03-26 05:40
    1. Fill the 3 gallon container and empty it into the 5 gallon container.
    2. Ship it
    3. If the customers complain tell them a one gallon upgrade will soom be available as version 1.1.
    4. Sell 1.1 upgrades in packs of 3 by shipping them full 3 gallon containers and let them figure it out themself...
  • MyKey_ 2010-03-26 05:41
    "... and pretty much every other technology under the SUN."
    You mean, like, ummh... Java?
  • Teemu 2010-03-26 05:47
    IF it sinks, it'll give you the volume.
    If it floats, it'll give you the mass.

    Come on now people, it's not that hard.
  • RayS 2010-03-26 06:21
    Bellinghman:
    You are allowed to assume certain things in these questions you know. Like the presence of air to breathe. Just not things that the original question said were not available.

    That's good. I'll assume the presence of a 4 gallon jug then. Job done.

    If that won't work, I'll go the marketing route, assume the presence of a sticker and pen, write out a "25% extra free" label, put it on the 5 gallon jug and fill it. Job done.
  • toshir0 2010-03-26 07:04
    If he's from Greece, you can easily put four gallons of water into the Senior Developper's a$$. But don't *even* ask me to do it.
  • Bellinghman 2010-03-26 07:34
    DaveK:
    Except of course that when you hit "Quote" on that post, you got to see the answer in plain text, before you snipped it away, immediately after the last word that you left in there. So not all that new to you...
    You know, I was looking for the word 'lose', and trimmed everything from that to the end. I didn't think to read what I was trimming out to see if it was different from what was on the screen. Because, you know, I was trimming it.

    What can I say? I didn't think to Google it either. My bad!
  • Patrick 2010-03-26 08:15
    DeepThought:
    Patrick:
    Does the Senior Programmer have no hands with which to type?


    Or has a sever case of carpal tunnel syndrome.


    Yes... last I checked, hands with CPT are not hands with which to type. Unless you want to make it worse.
  • dolomite 2010-03-26 08:34
    fumjoisey:
    jrh:
    wcw:

    What's bizarre is that they expect to get a smart, capable kid who can type fast in Manhattan for $20 an hour. What that kind of money in NYC actually buys you is something else entirely, like maybe a hand job from a crack whore in Jersey.


    Actually a hand job in Jersey isn't something you'd buy in NYC.


    Unless the crack whore has really long arms.


    The other option of hiring a crack whore to fly over to one of the channel islands to have a good time with is hideously expensive and would have to cover a longer time frame.
  • Josephus 2010-03-26 08:37
    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.
  • rfoxmich 2010-03-26 08:50
    Actually if the pair programmer is physically impaired in some way this is a sensible posting. E.g. blind, or movement impaired such that s/he can't type well.
  • Josephus 2010-03-26 08:56
    Remy Porter:
    SenTree:
    blem specified bottles which would mean the orifices are too narrow for insertion.


    Most expressions of that problem aren't that specific. Yes, in the case of bottles, that likely means the tops are too narrow. But then again, they are oddly shaped. This implies that our general assumptions about the bottles aren't safe, and that the bottleneck of the larger bottle could easily be large enough to insert a 3 gallon bottle.

    If the problem doesn't want the containers married, it should have specified it as impossible, not simply implied it.

    The issue is this: the "right" answer is tedious and boring. Bah, pour, empty, pour, empty. And it's tied to implementation- it'd be far more fun to solve the problem for any combination of containers and target volumes.


    What makes you think that the 3 gallon bottle fits inside the 5 gallon bottle? Surely that is as much of an assumption as determining the width of the hole. For all we know the 5 Gallon bottle may be spherical and the 3 Gallon bottle be cylindrical with a circumference of 1mm
  • Hi OJ 2010-03-26 09:12

    1. Fill the 3 gallon container and empty it into the 5 gallon container.
    2. Ship it
    3. If the customers complain tell them a one gallon upgrade will soom be available as version 1.1.
    4. Sell 1.1 upgrades in packs of 3 by shipping them full 3 gallon containers and let them figure it out themself...


    FTW!
  • Abdiel 2010-03-26 10:53
    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.
  • AndersI 2010-03-26 11:03
    Bellinghman:
    You are allowed to assume certain things in these questions you know. Like the presence of air to breathe. Just not things that the original question said were not available.


    OK, so we improvise a balance scale from <something not explicitly forbidden>, get the ratio of the two bottles weight, fill up the 3 unit one, put the 5 unit one at the appropriate place and fill it until we have balance.

    (It was quite exciting being on the wrong end of cross-the-pond conversions)
  • PITA 2010-03-26 11:26
    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?
  • too_many_usernames 2010-03-26 11:29
    Capt. Obvious:

    Given shock absorbers, height changes as a function of weight.

    This only works if you are willing to accept underestimating by the weight of the landing gear itself.

    I'd suggest the more accurate method (though much more complex) would be sum of (tire pressure)x(contact patch area of tire) for all tires. (Still a small underestimation there since it won't include the weight of the tire that comprises the contact patch.)
  • DaveK 2010-03-26 11:57
    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.
  • golddog 2010-03-26 12:35
    --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!
  • Dennis 2010-03-26 13:26
    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...

  • Matt 2010-03-26 13:31
    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)
  • hellosalute 2010-03-26 17:14
    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.
  • gilhad 2010-03-26 17:22
    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)
  • seebs 2010-03-26 17:58
    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.
  • daddy 2010-03-26 19:31
    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.
  • Boss 2010-03-26 19:52
    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.
  • Mike 2010-03-27 00:20
    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.
  • Duh! 2010-03-27 07:03
    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.
  • Random832 2010-03-27 14:09
    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.
  • puzzled 2010-03-28 16:01
    I find these puzzles interesting, but as interview tools I think they're horrible, not because they're ridiculous or easy to look up, but because they ARE effectively trick questions if you don't already know the solution, which moreover depends on how well you already know the subject matter of the puzzle:

    Water bottle puzzle:
    - I would start with something like "According to the rules, there is no way to fill or empty a bottle only partway and know how much is in it by looking at the bottle, therefore the complete list of possible actions is: (1) fill bottle 1 with 3 gallons, (2) fill bottle 2 with 5 gallons, (3) attempt to pour all of the water in bottle 1 into bottle 2, (4) attempt to pour all of the water in bottle 2 into bottle 1, (5) empty out bottle 1 on the ground, (6) empty out bottle 2 on the ground. I have to find some sequence of a subset of those 6 actions that ends up with 4 gallons of water being in either bottle." I wouldn't word it exactly like that, of course, but that would be my premise.
    - Given that set of rules, I wouldn't have to go far to prove that it's impossible to solve the problem with that set of 6 actions I created. So I must be missing something. Something about the properties of water in bottles, an unstated rule. Would I be able to guess what it is under the pressure of an interview? I've never had to, but my guess is, certainly not.
    - The missing rule in this case is: "When pouring water from one bottle to the other, it is possible to judge when the second bottle is full with sufficient speed and accuracy that no water is spilled and all water that can't fit in the second bottle at that instant remains in the first bottle."
    - I would argue that failing to state that rule has turned this into a trick question, and not a logic test at all, because the focus is entirely on how well you can guess this one unwritten rule instead of how well you can solve a fully-stated logic problem. I would have solved the problem easily if told that missing rule. But I have little experience at pouring water between bottles. My assumption that it is impossible to fill the second bottle from the first without losing track of how much water couldn't fit in the second bottle is so basic that it never would have occurred to me consciously that I am assuming it or that I am allowed to expect a hypothetical person to have a much higher level of skill at pouring water between bottles than I've ever observed (I would sooner have questioned my assumption that water is the only liquid I should be thinking about putting in the bottle). Getting past that is as much about cultural knowledge or personal background as anything else, which isn't what you want to test in an interview.

    "3 girls, 2 condoms and 1 guy" puzzle:
    - It would never have occurred to me that wearing a condom inside-out could possibly be considered safe, or that wearing two condoms at once could possibly be considered safe. So I would have had a laughably incomplete list of possible actions, and a whole lot of unrelated thoughts about sex to enumerate in hopes of finding the missing ones. The interviewer would undoubtedly run out of patience while I'm still considering that there might be something about (say) oral sex that I'm not thinking creatively enough about. I would not have thought to ask the question "So, what sorts of things can I do with a condom that are safe?", not least because of the embarrassment factor.

    Box with 3 switches and 3 light bulbs inside:
    - It would never have occurred to me in the context of this question to think that light bulbs get warm when turned on, or that touching the light bulbs while the box is open is even a possibility. The question-asker is expecting me to add a totally new axis to the problem that wasn't even hinted at by the logical setup of it, exactly like expecting me to guess that I can deduce what order the bulbs have been turned on in by sense of smell (maybe I can, I don't know, I don't have much experience with smelling lightbulbs either and if that really were the answer it would be equally crazy to expect it to come to people's minds).
    - All that shows (if anything) is that I'm bad at thinking outside the box about lightbulbs. I don't know about you, but I would rather know if a candidate is good at thinking outside of the box about something related to their job. If you were to ask me to think outside the box in order to solve some programming task, for example, I would do much better at it, even if the particular task is totally unfamiliar to me... Why not either add that extra bit of relevance or state the rules more fully to make it closer to a proper logic question, instead of asking trick questions like these ones?
  • lolwut 2010-03-28 21:22
    WHARTON, lol!
  • Kef Schecter 2010-03-28 23:44
    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
  • CBM 2010-03-29 00:20
    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.
  • Lang Sharpe 2010-03-29 04:24
    Our compensation reflects the importance of this position


    Your being paid to be a typist. You'll be paid the same as a typist?
  • kfh 2010-03-29 07:48
    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....
  • Dr. Evil 2010-03-29 08:52
    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!!
  • ParkinT 2010-03-29 09:09
    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.
  • VRAndy 2010-03-29 14:57
    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.
  • anonymous 2010-03-29 14:58
    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.
  • Carra 2010-03-30 06:40
    Heck, I came up with two different methods which require a basin.

    -2x5 in the basin
    -2x3 out of the basin
    -Done!
  • Nessuno 2010-03-30 10:13
    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.
  • Ren 2010-03-31 07:45
    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.
  • Maurice 2010-04-06 17:32
    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.


  • lisa 2010-06-12 16:20
    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.
  • Mark J. 2010-06-22 18:47
    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?
  • dgghua 2010-09-04 04:54
    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!
  • Ol' Bob 2010-11-24 13:08
    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!
  • drfreak 2011-01-03 22:07
    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 <i>pour it in</i>, no measurement required.
  • drfreak 2011-01-03 22:08
    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!
  • Prism 2011-07-11 05:12
    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.
  • Prism 2011-07-11 05:41
    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.

  • Prism 2011-07-11 06:16
    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.




  • Mike 2012-10-25 12:10
    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.
  • Isikyus 2013-10-31 09:37
    Congratulations! You now have four metric gallons of water.
  • Link to the company of paired programming 2013-12-10 05:25
    http://www.ufora.com/company/team/ ROFL