- 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
The socks
In a software context: just take them all, ram is cheap and the unwanted ones will be garbage collected once a pair is chosen. And hurry up, we have to get this code out the door.
Admin
But that IS adding in another element: the real-world knowledge that most light bulbs emit heat. And that's an unwarranted assumption, given that not only are we apparently using highly uncommon objects of other kinds (doors that no light escapes from, and that can only be opened once, are not exactly the most common type) but any other attempts to use real-world knowledge are specifically disallowed by the question-asker.
Allowing ONE single piece of real-world knowledge and NO OTHERS (hey, if it's that kind of bulb, I'll just have a look at it and see if the coil's broken - what do you mean I can't?) makes this a trick, not a puzzle.
And using trick questions in an interview is the mark of a very bad interviewer.
Admin
First, it is a question to get an idea of how someone solves problems, not to trick them. These kind of thinking problems usually involve a discussion, where the problem solver asks questions to eliminate assumptions. This puzzle really doesn't require many, of course, except for your claim that the problem solver's real-world knowledge is an outside element, you know, along with the assumption they have hands, can detect heat, can flip a switch, has eyes, and understands the language the puzzle was presented in!
The point is problem solving.
... Solver: Hey, are there any cracks in the box. Asker: Nope. Solver: What kind of bulb is it? Asker: A standard incandescent bulb. ...
There are many interview questions used in IT interviews that test not only knowledge, but the ability to solve problems.
I don't think you know what a good interview is. Maybe you have had difficulty with interviewers that want to know your problem solving skills, in addition to your book knowledge, memorization, and work history.
Admin
One thing to point out is that covers aren't just held in place by friction along the sides. There's a ledge/lip along the edge that the cover rests on! If you make that ledge much wider than the hole the workers go through, you can avoid that issue.
You'll end up needing to use more material than with a round cover, though. It's an easy solution to design, but needlessly inefficient.
Admin
Oh. I see. Your stuff's all enterprisey. Everything makes sense now.
Admin
I know this is way late. But if Omar wasn't ready to move on, the simple thing to do is apply for his job through the outsource company. Bang, new hire, no training, and hopefully he gets paid better.
Admin
To be honest I'm going to stop trying to be logic and simply use 'real world' knowledge.
Take the Chicken, Fox & Grain puzzle.
Why not simply kill the fox or chicken? It's not specified they have to get across the river alive.
You could tie the fox to the boat by the neck and force it to 'swim or sink'.
Honestly thought I'd assume the river is seasonal and simply wait for it to dry up. Some rivers do dry up and nothing specified says that this river doesn't - much like assuming that a hypothetical light-bulb should somehow generate heat.
[On that note, the real solution for the light-bulbs is easy - given I'm free to assume the box/cupboard is transparent to the light.]
Admin
Not to me. I habe been in a similar situation when I was working for a bodyshopper where i was told to say that i had worked on XYz project and done such-and such things. The projects were never real.
Admin
You beat me to it!
Admin
Plz supply name of bodyshopers in US of A.
Admin
America no sell full bodies any longer. It'd be chopped and sourced out. You'd be putting "Head & Shoulders" or similar to internet browser, yes.
Admin
Are you guys seriously telling me, that if you were actually presented, in real life, with the problem of determining which of three light bulbs was burned out, and they were switched off, you wouldn't just feel them with your hand? Really really?
The question seems to be geared to determine whether the interviewee has a functioning brain stem, not an actual test of anything.
Admin
FTA: "Being someone who has heard of a brainteaser before..."
Really, you heard of a brainteaser?
Admin
I accidentally left my resume available on the web for a short time and received it unchanged from 3 different outsourcing companies.
In each case I told the person, "I'm surprised I don't remember you from EVERY job I ever worked."
Admin
i always thought it was so they couldn't fall to their death- a square manhole cover can fit 'through' its hole diagonally - a circle has no larger diagonal than it's width, so no fall through-
Admin
If you know whether the odd coin is heavier or lighter, then with N weighings you can have as many as 3^N (3 to the power of N) coins.
If you do not know then the maximum number is 2^N (2 to the power of N).
In the first case then on each iteration you weigh one third on one side, one third on the other and eliminate 2/3.
In the second case you normally weigh 1/4 on each side until the last weighing, and eliminate half. (If they balance they are eliminated, if not the other half are).
On the last weighing you have 2 coins so you must weigh one against one of the rejected coins. If they balance then it is the last coin, if they do not it is the one you did not already reject.
Admin
Actually I reckon you can reduce always by a 3rd each time.
Weigh 1/3 against 1/3. If they balance, reject them all and keep the other third.
If not then we have 2/3 remaining at this point but now take 1/3 of the heavier ones and 1/3 of the lighter ones on each side, and you will find that you can iterate through this and eliminate 2/3 of them now. (If they balance it's in the ones that were left behind, and if not you reject the ones that switched from being on the light side to the heavy side and vice versa).
It's not an exact log(base 3) N but it's that plus a constant.
Alternatively, within 2 weighings you can find out if your extra is heavy or light then iterate through log(base 3)(N). One example of two such weighings is obviously half vs half and then from one half, half vs half again. Not the most efficient way but you will know for certain whether we have a heavy or light object and will be able to eliminate at least a half. More efficient would be 1/3 vs 1/3 to start and if they don't balance, pick half from each of those against the ones we left behind to start with. Now we have 1/6 of our original set and know if we are heavier or lighter, but if the first weighing balanced we will have to continue this strategy until we get a mis-balance. (However we have reduced by a third).
Therefore we can say it is halving for one weighing and then a third subsequently but if we get down to 6 (or 4) we require 2 weighings, so for W weighings we can manage with 4 * 3^(W-2)
W N 2 4 3 12 4 36 5 108 6 324
etc.
Admin
I can't edit my comments because I'm not logged in. Actually the maximum is 3^(W-1) or 2^W whichever is greater.
N W 2 4 3 9 4 27 5 81
etc.
Admin
Why the hell would I do that without prior knowledge of the temperature that the light bulbs can reach?
I mean given all the other bizarre shit that has to be true in order for the problem to make any sense at all. I mean, obviously the contraption isn't useful for giving off light, so surely it's designed to create heat?
Admin
Admin
I think we've established the interviewer wasn't big on brain power :)
Admin
Yeah, 5 in 3 measures isn't particularly difficult. Here's a solutions.
Put 1 weight on either side of the scale. If it balances, set one aside as a known-good, and discard the other. If it doesn't, replace one with one of the others. If they balance, it's the one you replaced. If they don't it's the one you didn't. If the first set balances, pick another set. If they balance, it's the last weight which hasn't been measured. if they don't, replace one of them with the known-good weight. If they balance, it's the replaced one, if not, it's the one you didn't replace.
Admin
Yeah, that is a lightweight. ;)
Admin
Binary search isn't really as clever as "trinary" search.
I always asked this one specifying that the object is either heavier or lighter.
Then the algorithm is:
Divide objects into 3 nearly even piles. Weigh the two equally numbered piles. They are either equal or one is the heavier(or lighter). The number of weighs required is ceil(log3(n)). Because log3(5) < log3(9), log3(5) < 2, and ceil(log3(n)) = 2 weighs.
For 8 objects, it is also 2 weighs.
Admin
I've been absent for a while, but now I remember why I used to love this site. Thank you, I'll try and check back more frequently. How frequently you update your site? cdebgkdbbadeaekc
Admin
Admin
i've read several versions with 12 weights in 3 weightings.