- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
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.
Admin
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?
Admin
wow small world!, so I know Braxton (the guy from the craig's list posting). He has severe carpal tunnel
Admin
eh... I feel woozy. What just happened there?
[image]Admin
I'd fill the 5 gallon jug completely, if it's 5 US gallons. That's still 4 Imperial gallons.
Admin
Admin
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.
Admin
DEFINE 5 4;
Admin
But that is an even number of steps.
Admin
Did anybody read this?
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.
Admin
Was it a european or african 747?
Admin
Admin
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.
Admin
...and get 4 litres instead of 4 gallons?
bzzzzt... next!
Admin
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?
Admin
Admin
Or has a sever case of carpal tunnel syndrome.
Admin
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.
Admin
Fill the 747 with water, place it on a scale, fill the 5 gallon container from the 747... wait, what was the question again?
Admin
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.
Admin
Then you'd have a little over 1 gallon. UNIT WEIGHT FAIL!
Admin
Ah! So that's what the "Quote" button does.(D'Oh)
Admin
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!
Admin
Admin
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.
Admin
If Reply isn't comment-specific, why is there one button per port?
Admin
Admin
... per post
Admin
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.
Admin
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.
Admin
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.
Admin
Under. A gallon is ~4.6 litres.
UNIT VOLUME FAIL!
Admin
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".
Admin
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....
Admin
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:
Admin
And everyone knows you weigh a 747 by putting it in a bath and weighing the displaced water.
Admin
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.
Admin
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.
Admin
Perhaps it is a homeopathic principle - the water remembers the shape of one of the containers, so can't be poured into the other.
Admin
Nonsense, you run the dying person down. They are dying after all. Put them out of their misery.
Admin
Nope. Wrong.
You call an ambulance for the dying guy, give your friend bus fare, and f*** the girl in your car.
Admin
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?
Admin
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.
Admin
Admin
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.
Admin
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.
Admin
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.
Admin
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!!!
Admin
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.
Admin
I stand corrected