 Feature Articles
 CodeSOD

Error'd
 Most Recent Articles
 Just Beastly
 All Michael
 Just a Taste
 Beer and Peanuts
 It's Our Party
 ABQ is the bomb
 Left Hand Right
 Testing 1,2,3,4,5
 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
Ok, the weight of the earth on me is ~myMass*9.81m/s²
Admin
Admin
Admin
You mean one quarter
Admin
You mean one quarter
Admin
May i point you to XKCD?
http://xkcd.com/c246.html
Admin
You're right; I was thinking the problem from the angle of picking an arbitrary machine to place the first quarter in, but realized you should simply choose the machine that falsely claims it is mixed.
My bad.
Admin
Dont know if it has been posted but I think the answer to post one is one person agress to say pass if he can see two red hats, the other if he can see two blue hats and the third if he can see three of one colour. Then just wait till one (or two) of you say pass and the third person will get his right.
Admin
Dont know if it has been posted but I think the answer to post one is one person agress to say pass if he can see two red hats, the other if he can see two blue hats and the third if he can see two of one colour. Then just wait till one (or two) of you say pass and the third person will get his right.
Admin
That last comment was meant to read two for each part, not three on the last
Admin
Interesting response! That would truly make the crappy interviewer shit a brick, and it'd be hilarious for you, but would it really help? I think everyone here needs to remember that you've got to be evaluating your interviewer(s) as much as they are evaluating you.
For instance, if I got this brain teaser from the hiring manager of a group of researchers working at a place like Google or a biomedical firm that does heavyduty development of newfangled projects and I was truly interested in the career, not just the "job" being offered, then I'd probably do my best to rock whatever riddles he or she threw my way  providing I also was liking the personality of the hiring manager.
If, however, I was asked these riddle questions by some HR lacky, a recruiter for the company, or someone in the professional role of hiring people, then I'd probably tell 'em to foff with a snappy comment like the parent poster makes about Microsoft.
You've got to pick your battles so as to really win the employment war you will wage throughout your career. Battling over EVERY interviewing technique that you dislike during this war probably won't help your longterm strategy of selling yourself to the best employers at all times. But fighting the battles over these riddle questions with stupid employers or HR lackey's can help you longterm as you'll continue to learn when to walk away from a job opportunity, and when to RUN because you'll be able to more quickly and accurately recognize value of a job, versus just it being "a job."
Admin
You didn't take elementary school science, right? For all intents and purposes (First Order computations), the mass of objects can be considered to be concentrated at their center of mass. It only gets interesting when we consider the second and third order computations such as nonsphericity of the planet, irregular mass concentrations, and the (surprising to some) fact that one can't fly very close to the center of mass of a planet. (ouch!)
Admin
In Robert Heinlein's juvenile novel "Space Cadet", the initial exams for the Space Patrol's academy includes having to deal with incomprehensible instructions for some device with switches and levers etc etc, and I have always assumed the point of that question would have been to see how long someone would screw around getting nowhere before demanding some kind of clarification.
So there is something to having tests that see what you do.
PS: How do you move Mount Fuji?
Admin
If we are allowed to resolve any ambiguities in the question with whatever data we want, the hat problem becomes trivial:
simply insist on using a twoheaded coin to determine hat distribution. Assuming that the color assigned to a cointoss result of heads, the rule is simply to guess the same color as the other two are wearing.
Or use my girlfriend's first thought: after your in the room, swap hats with another player. No information is being shared, you never see the color of your own hat, and yet you know the information.
More interestingly, if you don't control the distribution, and cannot confirm that it is indeed random, and they people assigning hats both hear your plan and act to make it fail (which seems slightly more realistic), the one person guessing is the best strategy, assuming that person doesn't announce his guess in the planning session.
Admin
Why not ask an open ended question?
Because then the interviewer doesn't get to feel smugly superior when you don't get the correct answer.
Admin
Round is not the only shape that guarantees this. A star shape will also work, as will several others. The benefit of being round is that the covers can be easily rolled and manufactured.
For the given question, this is the optimum solution. Generally speaking, theory is leaning toward the use of Hamming codes to determine the correct solution, which put the chance of winning at (if I remember correctly) (N1)/N. That means the more people that are playing, the better your odds are, which is pretty counterintuitive, but really cool mathematically.
As far as these tests go, I'm completely for their use in interviews (when used in conjunction with more standard approaches). My company uses them, and each test is designed to specifically test certain aspects of how you think. You don't have to get the question correct in order to pass the test  It's more about seeing how you think, so it's very important to think out loud and describe your thought process, even if it's wrong. Getting stuck in a rut while solving these problems if worse than trying 100 wrong answers.
There is also an integrity aspect to the questions. If you come up with the correct answer quickly but can't talk through the logic, that's a big hit against you since it indicates you already knew the answer (we tell you up front to stop us if you've heard the question before).
That said, we also ask coding questions to see if you understand some key programming concepts (e.g. recursion). Both sets of tests tell you different things about a candidate and may be weighted differently in the final consideration based on the position. If I'm looking for a code monkey, how much does it matter that they didn't get the logic questions when they got all the coding ones? However, for higher level positions, the logic questions are more important since you do more abstract problem solving than coding.
Ultimately it comes down to how well the interviewer can determine if the candidate fits the position, and I don't care what (legal) questions they use to make that determination. As for the WTF, I think the candidate gave a valid firstpass answer, which I would have followed up with another requirement.
Admin
1.21 gigawatts? ;)
Admin
Admin
I interviewed with Microsoft too, and they didn't ask me any sorts of these riddles. Their questions seemed very fair actually.
I sent in the story about the blind people bike, and you would never guess everyone's favorite company who asks ridiculous questions like this. I'll give you a clue though, it starts with a "G" and ends with "OOGLE"
Thank you WTF for articulating my gripes better than I ever could.
Admin
Couldn't agree more. You might enjoy my posting which is similar in sentiment:
http://radio.weblogs.com/0103955/categories/stupidHumanProgramming/2007/03/12.html#a238  What if Cars Were Rented Like We Hire Programmers?
Admin
Captcha: sanitarium  appropriate for some people after reading this thread.
Admin
My solution for the three hats problem:
Given a sequence of three (or more) hatted people: Each person looks at the hat on the person to his left (wrap at the end of the sequence). Then each person pases their hat to the person to their right (again, wrap at the end of the sequence). Each person now knows what color hat they are wearing, even if they physically cannot see their own hat (or the one they started with).
Admin
Amen to that... quite entertaining, though.
too many trips, I think.
My solution, saves one trip...
captcha: bling
Admin
Admin
They simply fail to differentiate between "a decimal followed by an infinite number of 9's" and "a decimal followed by a very very long (but finite) series of 9's". That is how come I've seen people say that the average of 0.999... and 1 is "0.999...5".
Admin
See, you would fail the interview, because that's not just wrong, but completely stupid. You didn't even read the question.
Admin
Frayed knot: d, s, g, p < (f) m state is now d, s, g, p, f
f+d ftl
Admin
[quote user="Flash"][quote user="Rodyland"]Half right. There are two shapes that won't fall in. Round covers won't fall in, and triangular covers won't fall in. [/quote] Wrong. A triangular cover can fall through its hole, as can any polygon.
Let's assume you mean an equilateral triangle.
Place the triangle vertically, with one side perpendicular to the ground. Its widest point is "h" (the "height" if the triangle). However, the widest part of the hole is "l" (the length if a side). Given that
you can see that "h" is less than "l", and the triangle can therefore fall through.
A quick Google found http://www.drainspotting.com/mirror/nhtelegraph20031126/ with some more information. A "Rouleaux triangle" won't fall through. However, this is not a polygon, but a rounded "triangleish" shape.
They key is to find shapes with the same property as circles  constant diameter. And there are an inifinite number of such shapes, not just triangular.
So, yes, a circle isn't the only shape that can't fall in. But, any polygon can.
Admin
Some jobs are for code monkeys and all that matters is whether you can program. Some jobs require thinking and problem solving. Obviously someone has determined that working on a riddle can be a good way of judging your problem solving techniques. If you don't like it, go read a tech spec.
Oh yeah, guess which ones pay more.
Admin
Admin
Admin
1: Toast A1 and B1 2: Toast A2 and C1 3: Toast B2 and C2
Admin
[quote user="Ken"][quote user="Flash"][quote user="Rodyland"]Half right. There are two shapes that won't fall in. Round covers won't fall in, and triangular covers won't fall in. [/quote] Wrong. A triangular cover can fall through its hole, as can any polygon.
Let's assume you mean an equilateral triangle.
Place the triangle vertically, with one side perpendicular to the ground. Its widest point is "h" (the "height" if the triangle). However, the widest part of the hole is "l" (the length if a side). Given that
you can see that "h" is less than "l", and the triangle can therefore fall through.
A quick Google found http://www.drainspotting.com/mirror/nhtelegraph20031126/ with some more information. A "Rouleaux triangle" won't fall through. However, this is not a polygon, but a rounded "triangleish" shape.
They key is to find shapes with the same property as circles  constant diameter. And there are an inifinite number of such shapes, not just triangular.
So, yes, a circle isn't the only shape that can't fall in. But, any polygon can.[/quote]
Just to further explain without the math as people here seem not to get it.
Take an equilateral triangle and a hole it covers. Pick the triangle up and try to put in in the hole with one point down. The remaining to sides will prevent the cover from falling in. Now angle the inserted point to one corner of the hole. Since the point can get in part way, then angle under the lip of the hole, a second corner can now pass through the hole. Once a second corner is in, it is easy to drop it and have it fall through.
Forget about working on a plane, manhole covers have six degrees of movement in threedimensional space. If we were working purely on a plane (two dimensional space) then an equilateral triangle would not fit.
Admin
Admin
[quote user="KattMan"][quote user="Ken"][quote user="Flash"][quote user="Rodyland"]Half right. There are two shapes that won't fall in. Round covers won't fall in, and triangular covers won't fall in. [/quote] Wrong. A triangular cover can fall through its hole, as can any polygon.
Let's assume you mean an equilateral triangle.
Place the triangle vertically, with one side perpendicular to the ground. Its widest point is "h" (the "height" if the triangle). However, the widest part of the hole is "l" (the length if a side). Given that
you can see that "h" is less than "l", and the triangle can therefore fall through.
A quick Google found http://www.drainspotting.com/mirror/nhtelegraph20031126/ with some more information. A "Rouleaux triangle" won't fall through. However, this is not a polygon, but a rounded "triangleish" shape.
They key is to find shapes with the same property as circles  constant diameter. And there are an inifinite number of such shapes, not just triangular.
So, yes, a circle isn't the only shape that can't fall in. But, any polygon can.[/quote]
Just to further explain without the math as people here seem not to get it.
Take an equilateral triangle and a hole it covers. Pick the triangle up and try to put in in the hole with one point down. The remaining to sides will prevent the cover from falling in. Now angle the inserted point to one corner of the hole. Since the point can get in part way, then angle under the lip of the hole, a second corner can now pass through the hole. Once a second corner is in, it is easy to drop it and have it fall through.
Forget about working on a plane, manhole covers have six degrees of movement in threedimensional space. If we were working purely on a plane (two dimensional space) then an equilateral triangle would not fit.[/quote]
Further edit so people don't complain again. The math posted above assume the hole is exactly the same size as the cover, which can't happen because then the cover will fall through, there is always a lip, and this lip can reduce the sides of the hole to less than the max height of the triangle. Still, angeling the cover in will allow it to pass thorugh the hole.
Admin
Admin
Admin
I had the same idea, but the original question stated that there could be no communication. Pointing is communication.
Admin
You're assuming they get off the boat... so long as f stays on the boat, then the condition is never broken. Although I concede that getting f,s off the boat and m back on without breaking the rule might be tricky, but then again, f is there with m,s so it should pass...
captcha: slashbot
Admin
(Note: my first attempt started with "put a quarter in each machine". However, this is a refinement.)
Put a quarter in the "apple" machine. If the "apple" machine gives an apple, it's obviously the "both" machine. That means "orange" is really apples and "both" is really oranges. Answer solved with one quarter.
If not yet solved, put a quarter in the "orange" machine. If "orange" gives an orange, you have the same as the first scenario (reverse "apple" and "orange"), and everything is solved with two quarters.
If still not yet solved (ie: "apple" gives orange, and "orange" gives apple), then put a quarter in "both". If it gives apple, it must be apple, "apple" must be orange, and "orange" must be both. If it gives orange, same thing in reverse. Everything solved with three quarters.
Answer: it may take as little as one quarter, but it will take at most three, assuming that all of the signs are incorrect.
Admin
Put a quarter in the "both" machine.
If it's an apple, then "both" is really "apple", "apple" is really "orange", and "orange" is really "both".
It it's an orange, then "both" is really "orange", "orange" is really "apple", and "apple" is really "both".
One quarter, always.
Admin
hmm, really? they said the odd coin out could be lighter or heavier than the others. you may discard the half of the set that contains the odd one out, in which case your remaining comparisons will find nothing. i'd stick with the simple answer: you can do it in n1 comparisons. pick one coin, and compare all the others to it. if you're lucky, you can find the answer in two comparisons. if you're unlucky, you find it in 7 comparisons.
Admin
"For myself, I couldn't understand why I would have to artificially bloat up my working by 200300% just to meet someone else's standards; and I still don't get arbitrary rules nearly two decades later."
No hire; not a team player.
Software creation is a team effort. Sammy Sosa playing just by himself couldn't beat a ordinary baseball team, and I'd be willing to bet money that however good you are, you're no Sammy Sosa.
Admin
FOr the hat problem, the probability is 50%.
There are four possibilities (and four more that are mirrored): 000 001 010 011
As you know, person A is one of the posters who is one of the posters on WTF that constantly insists on giving an incorrect answer, and has a gag forced upon him by the others.
The results are: 000: B and C give incorrect answers. A would also give a bad answer. 001: C gives a correct answer. 010: B gives a correct answer. 011: B and C pass. Since A has a gag, he would give an incorrect answer anyway (in spite of the fact that a more intelligent player would be able to correctly guess.)
However, 50% is much better than the alternative where person A is permitted to mess up the game with a known incorrect strategy. If you want to get the "011" case, you'll need to replace player A with someone who is intelligent.
Captcha: Atari. Play well.
Admin
Okay. You have 8 quarters. One of them is offweight. Unfortunately, you do not have a scale, but you do have three mislabeled vending machines, one of which always dispenses apples, one with oranges, and one with both. Unfortunately, if you put an offweight quarter into a machine, it will malfunction and dispense the wrong fruit  this doesn't really matter for the "both" machine, but it will cause the "apples" machine to dispense an orange, and the "orange" machine to dispense an apple. What is your strategy for determining which vending machine is which, using as few quarters as possible?
b) Damnit, they took the signs away. On the bright side, rather than being random, the combination machine now alternates fruits perfectly (AOAO... or OAOA...). Putting in a defective quarter still causes the opposite of what was supposed to come out (so, a chain of normaldefectivenormalnormal would yield either AAAO or OOOA in a both machine, AOAA in an apple machine, and OAOO in an orange machine). What's the minimum number of quarters required to determine which machine is which? (One of your quarters is still offweight.)
(The first one is easy. I believe I have a strategy and answer for the second one, but it's not a proof yet.)
Admin
Nope. 5 measurements max in a pessimistic case.
coins: c1  c8
if(c1+c2+c3 = c4+c5+c6){ //(1) ..if(c7=c1){ //(2) ....ans=c8 ..}else{ ....ans=c7 ..} }else{ ..if(c1=c2){ //(2) ....if(c3=c7){ //(3) ......if(c4=c5){ //(4) ........ans=c6 ......}else{ ........if(c4=c7){ //(5) ..........ans=c5 ........}else{ ..........ans=c4 ........} .....} ..}else{ ....if(c1=c7){ //(3) ......ans=c2 ....}else{ ......ans=c1 ....} ..} }
Admin
Grandpa said that everyone had to guess right (at least one and all) to win. So, the 3 random hats have a 1/8 or 12.5% chance of success. Each guesses right 1/2 of the time AND 3 people guess; (1/2)^3 = 1/8.
Brainteasers often have mounds of useless information.
Admin
This thread has convinced me brainteasers can be useful in an interview:
Admin
Admin