- 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
Did you put on a shit-eating grin and say to the teacher "Problem?"
Admin
You are looking at the puzzle from only one perspective. Try instead to look at the value to a leader who values efficiency and common sense in his team.
Admin
Admin
As for geoffrey, his trolling is so subtle that it's redundant to all the genuine stupidity circulating around here.
The plague of Nagesh doesn't even try to troll. It's just line noise at this point.
Admin
Admin
If that's truly the "point" of the light bulb puzzle, its design is even worse than I imagined!
Admin
He can't possibly be serious.
Admin
Failure is part of life. So wouldn't your attempt at a solution be one that gave you the greatest probability of success?
Admin
I have never worked in a place where the lightbulbs produce heat and the lightbulbs my landlord gives me for free do not produce heat either. Therefore your assumption that most lightbulbs produce heat is outdated.
Admin
Or, did you forgot to mention that the room is dark and you can't see the socks, which is quite important to this puzzle. In that case, you'd be correct that 3 would guarantee a proper pair. It being too dark to see them, however, you only have a 1 in 3 chance of getting a proper pair on your feet.
Admin
Admin
If I am interviewing for a web development position, and a candidate has no idea what a 404 is, s/he has something to explain...
Admin
If I am interviewing for a web development position, and a candidate has no idea what a 404 is, s/he has something to explain...
Admin
Interestingly, the biggest reason that we expect people (even outside of the Web Development space) to know what 404 is, because we are obsessed with bashing them over the head with it....
Admin
Admin
No offense, but that's very Web 1.0 thinking. Modern development platforms have abstracted error codes into semantically meaningful data items. I care little if someone has committed a bunch of arcane error numbers to rote memory.
Admin
Oh, goody, it's Nagesh's annoying little brother.
Admin
Admin
This is just plain wrong. For the version of the problem where you do now know if the fake coin is lighter or heavier, and need to determin which it is, the maximum number of coins you can have for n > 1 weighings is c = (3^n - 3)/2.
Conversely, the minimum number of weighings for c > 2 coins is n = ceil(log3(2c + 3)).
Admin
[quote user="geoffrey"][quote user="404d"][quote] No offense, but that's very Web 1.0 thinking. Modern development platforms have abstracted error codes into semantically meaningful data items. I care little if someone has committed a bunch of arcane error numbers to rote memory.[/quote]
Yes, as Vertiy Stob says, nowadays the standard approach on handling an exception is to send the user a page of ODBC diagnostics, preferably mashed up with a few suggestions from Apache.
Admin
Ha! We were interviewing candidates for our offsore team member positions and I KNEW that subsequent candidates would be given hints about our interview questions given to previous candidates. During the interviews, the handler is always on the phone too for some reason.
So I laid a little trap.
I asked the first candidate how they would handle parsing a 20GB XML file on a machine with only 4GB of memory. They didn't know, of course. So in my feedback, I put "did not know when to use a SAX or a DOM parser".
The next candidate I ask, "What is the difference between a SAX and a DOM parser." The answer: "Well, you can use a SAX parser to parse a 20GB XML file on a machine with 4GB of memory."
As if.
Admin
I had to leave this site because of the abysmal quality of trolling. I was trolled so badly, when all I did was express my honest opinions.
Admin
If you create a 20GB XML file, you're doing it wrong.
Admin
The answers are actually wrong, and since you didn't notice they are also persuasive. So he does count as a troll.
Admin
How about the perspective of hiring a programmer who is more than happy to use undocumented and unreliable side-effects of systems?
Though it's a good question for a hacker :P
Admin
You left out the actual trap: "Describe how that is."
Admin
Why can't interviewers ask more challenging questions like:
What's the quickest way to toast 3 slices of bread on both sides under a grill that toasts only two slices, and only one one side of each, at a time?
Admin
Are you 5 years old? Are you seriously suggesting you know that lightbulbs generate heat?
Admin
You're not necessarily right. If the day before the last day all the leaves drop but one, then on the last day there's only that one leaf left to drop, and be blowed to your mathematics.
Admin
Only one carriage fell over, then?
Admin
Actually, the real answer is 7.
Try it out.
I found that when it comes to socks, all theory is useless.
Captcha: "enim" = "truly"
Admin
Presumably the question is to determine which of the bulbs in the box is broken, with the limitation that when the box is open all the bulbs are turned off.
I'd put the question back to the questioner: "How do you know one of the bulbs is broken if you can't see them when they're lit? Oh, so you've stuck an ammeter into the circuit to see it's drawing only two thirds the current. So why can't you stick the ammeter into each individual circuit? I can see why you need a new system designer - you've just fired the idiot who built this box of lights. Have you got one of those devices that you clip round the wire and it measures the magnetic flux, so determining the current going through the wire? ..." etc.
Admin
i certainly miss the "data flow" feature. and garbage collection, but i suppose that would make 98% of web display just a blank page so it's a good thing... maybe?
Admin
The first sock you pick will always be right (or left) The chance to pick a correct second sock is now 9 out of 19. So not 1 out of 3 but almost 50%abico
Admin
If you can't see what color socks are in your drawer, how does it matter how many socks you fetch? You always have the same chance of ending up with two different socks on your feet.
Unless I'm missing some vital information in this question, such as "you can, for some reason, only turn the light on AFTER you have got your socks from the drawer." For putting your socks on in the dark, it doesn't matter how many socks you have in your hands. So why can't you just turn the light on first?
Admin
Brighter FFS, brighter...
Admin
One extra failure is when you put both blues, but they didn't match brown shoes (which you pulled randomly, too)
Admin
Admin
For not knowing whether the weight is larger or smaller, and not needing to determine that: c = (3^n)/2 and n = ceil(log3(2c)) [Usually what I assume upon hearing this sort of problem] For knowing in advance: c = 3^n and n = ceil(log3(c)) [Apparently what the 8 coins 2 weighings version is]
Admin
I never actually heard the lightbulbs thing. How does that one go?
Admin
I could actually see a situation where this might be the case. Walk-in-closet without windows, light burnt out*. Sock drawer's in back, it's hard to tell what color sock is what, but all you need is a matching pair of either kind. Take 3 socks and wear the 2 that match.
*Well, we could replace it, but the guy who wired the house was a moron and we can't tell what switches or breakers go to it. And for some reason after tripping a breaker we can't reset it.
Admin
Seriously, please, STFU with the fucking brain-teasers (nothing personal Puzzles, this is just the point where I couldn't stand it anymore)
Admin
If it wasn't clear the idea is that after taking the socks you could verify in a better-lit area which two matched. But it probably is and I'm just thinking it isn't because I'm up at 3:30 AM for no good reason.
Admin
The answer's obvious and trivial to remember once you know it; it's a stupid “A-ha!” question that reveals that the interviewer isn't very good at it. A good interview question should be either genuinely tricky or thoroughly open-ended; in the former case, you're testing whether they actually know what they claim, and in the latter case you'd be looking for whether the interviewee identifies the major strategies for tackling the problem.
Admin
That or, if he's actually genuinly into riddles, you can solve it for him, then ask him another one. Good interview will be good then :P
Admin
Solution to the 5 weights problem:
Admin
3 weighs if you want to know whether it's heavier or lighter. With weights ABCDE:
Weigh(1) A+B against C+D. If they match then E is different. Weigh(2) E against any other weight to determine heavier or lighter.
Otherwise: Weigh(2) A against C. If unmatched then weigh(3) A against E
If same: Weigh(3) B against E If unmatched then B is different, heavier or lighter If same then D is different. Result of A+B vs C+D comparison determines whether D is heavier or lighter.
Three weighs, heavier/lighter known.
Admin
The question usually assumes a balance scale (at least for the 8 weight issue).
For that:
So 2 weighings for 8 on a balance scale.
Admin
Actually, you'd have a better than 1 in 3 chance.
Admin
Or from the perspective of hiring someone who just gets things done. I don't care how it's done; I just want results.
Standing in front of a whiteboard all day does not lead to results.