• Flo (unregistered) in reply to Jno
    Jno:
    2/3. You were asked to estimate the weight of the Earth, and you have outlined a method for measuring its mass. Nice try, would you consider the intern position? :))
    Damn :D

    Ok, the weight of the earth on me is ~myMass*9.81m/s²

  • YourMoFoFriend (unregistered) in reply to gwenhwyfaer
    gwenhwyfaer:
    Or his sense of self-preservation?
    How's that? By showing that he is so full of himself that he'd rather blow an opportunity than give a riddle at least a try?
    I've worked in enough small startups to know that one WILL encounter an unexpected problem that has nothing to do with ones particular job description, and that one WILL have to solve it.
    Yeah, that can be lots of fun. Having to do it for some arsehole sat smugly in front of you who couldn't distinguish a decent programmer from a pint of milk is less fun, and any startup who uses such a person to assess new hires will be a shutdown pretty soon.
    And you know that interviewer is an arsehole how? So far he just put you in an unexpected situation and you showed your total inability to handle it, not to mention your lack of respect to the interviewer.
    Do you want to hire someone that did walk out on an interview?
    In a fucking heartbeat. Would you want to hire the person who wished they had?
    No way. These are the same arseholes that think everything in a company revolves around them. WRONG. Business revolves around business, sales, marketing and sometimes... well customers and their needs. And more often than not customers needs are unexpected, stupid and yet have to be done the way customers want them to be done. Last thing I need in my team is the guy who walks out instead of at least trying to analyze and solve a problem
  • (cs) in reply to Richard@Home
    Richard@Home:
    Put on A and B, have sex with 1. Remove B, have sex with 2. Turn B inside out, have sex with 3.

    Um, nope - that doesn't work because you will infect yourself with whatever 1 was carrying. (The outside of condom B would become the inside when you were having sex with 3)

    The real WTF here is that I've actually spent time thinking about this O.o

    And yet you still failed to get it. You never take off Condom A, you put the inside out B on top of it.

  • GMan (unregistered) in reply to Anonymous Coward

    You mean one quarter

  • GMan (unregistered) in reply to GMan
    Assuming you mean that all signs are guaranteed to be wrong on the vending machines, you only need 2 quarters.

    You mean one quarter

  • Insensitive Clod (unregistered)

    May i point you to XKCD?

    http://xkcd.com/c246.html

  • Anonymous Coward (unregistered) in reply to GMan
    GMan:
    Assuming you mean that all signs are guaranteed to be wrong on the vending machines, you only need 2 quarters.

    You mean one quarter

    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.

  • matt (unregistered)

    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.

  • matt (unregistered)

    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.

  • matt (unregistered)

    That last comment was meant to read two for each part, not three on the last

  • (cs) in reply to Anonymous
    Anonymous:
    I interviewed for MS once and was asked a few of these questions. I probably failed miserably, but not because I am incapable of answering the questions. Answering these is just not in my frame of reference when I am interviewing. I prepare carefully for the subject of the job, and I guess I'm blindsided when concentrating on having a good interview and then suddenly thrown a question out of context. I think this would be the equivalent of walking over to a software engineer's cube and asking them the appropriate temperature at which meat can be assumed to be fully cooked. Why the hell would most engineers know that?

    I did, however, ask why the person was asking me the question. The response was, "I want to see how you think."

    Well....I have since come up with the exact answer I will give the next time (if ever...I doubt I'd ever apply at MS again) I am asked this question:

    If you are asking this question to see how I think, then there can be no right or wrong answer. Unless you have specific criteria in which you will give me some sort of "grade" by which to compare me to other candidates that are asked the same question, what you are really asking for is my opinion. In my opinion, a question that involves solving a puzzle is hardly relevant to providing a software solution to a non-arbitrary, real world business problem. But since you asked, here is what I think:

    1. Did the people that architected, approved the release of, and implemented that disaster called ActiveX prove that they were exceptional people by answering this type of question? Would you hire them now if you could see the future? If I let you watch me write an ActiveX control right now that pwnz0r3d your box, would you hire me?

    2. How about the people that came up with COM/COM+ as the future of cross platform development? I guess that little performance problem called marshaling that is done WITH EVERY SINGLE METHOD CALL sort of killed it, eh? Not to mention that it never actually went mainstream with those bogus cross platform problems.

    3. Microsoft Bob. Enough said.

    4. If this interview method lets you only choose brilliant people, why is it that so many security holes are found in your software that involve simple buffer overruns?

    5. Did the developers and QA people responsible for letting BizTalk 2004 out the door when it would crash when receiving a file larger than 2GB (or was it 3GB?) prove they were k-k00l, aw3s0m3, and l33t people by answering these questions?

    I could seriously find a lot more points I think. If your interviewer, imho, can't figure out if you're skilled from just asking you questions about relevant past experience or even questions relevant to the job position, they are the wrong interviewer.

    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 heavy-duty development of new-fangled 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 f-off 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 long-term 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 long-term 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."

  • bronzy (unregistered) in reply to brazzy
    brazzy:
    Flo:
    - Measure the gravitational constant, find your own mass and the radius of the earth, use Newton's law of universal gravitation. Simple.
    Simple and quite wrong, since the Earth's mass is not concentrated in a point and thus not all at the same distance from you.

    Addendum (2007-05-16 07:02): A better approach would be to compute the Earth's volume and multiply it by a guesstimated average density. IIRC most kinds of rock are about 6 or 7.

    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 non-sphericity 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!)

  • Bobbie The Programmer (unregistered) in reply to Rodyland
    Rodyland:
    Wow, seriously, some of you amaze me.

    Whilst I originally thought that brain teasers are stupid in job interviews, your answers have provided me some insights into what they could actually be useful for: testing your ability to read, comprehend and follow basic rules and instructions.

    Based on many answers so far, a lot of you would fail.

    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?

  • Undefined Reference (unregistered)

    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 two-headed coin to determine hat distribution. Assuming that the color assigned to a coin-toss result of heads, the rule is simply to guess the same color as the other two are wearing.

    Or use my girl-friend'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.

  • Bobbie The Programmer (unregistered) in reply to Franz Kafka

    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.

  • boldtbanan (unregistered) in reply to NotanEnglishMajor
    NotanEnglishMajor:
    Rodyland:
    - Why are manhole covers usually round? Round is the only shape that guarantees, no matter how you orient the cover, that the cover will not fall into the manhole and onto the man in the hole. That's why I only ever use round covers on my manhole.

    at problem - make the strategy be: The person who sees two other people with the same colour hat calls out the opposite colour. He's got a 3/4 chance in being right. There is a 1/4 chance that they are all the same colour, in which case they'll all call out the (wrong) opposite colour.

    • 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) (N-1)/N. That means the more people that are playing, the better your odds are, which is pretty counter-intuitive, 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 first-pass answer, which I would have followed up with another requirement.

  • Anonymous (unregistered) in reply to Alex
    Alex:
    I was once asked how many watts were in a bolt of ligtning. I even got it right ;)

    1.21 gigawatts? ;)

  • Jno (unregistered) in reply to tastey
    tastey:
    M.G.:
    It reminds me of the people who can't accept that .99999999... (repeats forever) is exactly equal to 1.
    Right, just like 1 over infinity equal nullity! And for the record .999999... (repeating ad infinitum) does not equal 1, but is close enough for all practical (and most impractical) purposes.
    > people who can't accept... Oh, look! There's one! M.G. is right; 0.999... is exactly equal to 1. It's only an approximation to 1 if you stop before infinity. Are you there yet? No, keep going.
  • Sarcastic Interviewer (unregistered)

    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.

  • todd (unregistered)

    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?

  • Ken (unregistered) in reply to tastey
    tastey:
    And for the record .999999... (repeating ad infinitum) does not equal 1, but is close enough for all practical (and most impractical) purposes.
    Yes, 0.999... exactly equals 1. If you say that 0.999... is not exactly one, then what is the value of "x" given:
        x = 1 - 0.999...
    (Note: the correct answer is exactly 0.) Or:
        x = (1 + 0.999...) / 2
    (Note: the correct answer is exactly 1.)

    Captcha: sanitarium -- appropriate for some people after reading this thread.

  • Kehvarl (unregistered)

    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).

  • EnderGT (unregistered) in reply to JM
    JM:
    First of all, the whole hat thing has evolved to be quite a WTF itself...

    Amen to that... quite entertaining, though.

    Anonymous :
    Ok, this has many WTFs in its own, but let's extend the boat ride riddle:

    In one side of the river there are:

    • a father with his son
    • a mother with her daughter
    • a security guard with a prisoner

    The boat has a capacity of two, but only the father, mother and security guard can operate it.

    The father can't stand the girl if her mother is on the other side of the river The mother can't stand the boy if his father is on the other side of the river The prisoner will kill any one if the guard is on the other side of the river

    How can they all get to the other side of the river?

    JM:
    Let's try (f=father, s=son, m=mother, d=daughter, g=guard and p=prisoner):
    m, d, g, p ---(f, s)-->
    m, d, g, p <--(f)------ (s)
    d, g, p    ---(f, m)--> (s)
    d, g, p    <--(m)------ (f, s)
    m, d       ---(g, p)--> (f, s)
    m, d       <--(f)------ (s, g, p)
    d          ---(f, m)--> (s, g, p)
    d          <--(g, p)--- (f, s, m)
    p          ---(g, d)--> (f, s, m)
    p          <--(g)------ (f, s, m, d)
               ---(g, p)--> (f, s, m, d)

    too many trips, I think.

    My solution, saves one trip...

    m, d, f, s, g, p  	
       d,    s, g, p      (f, m) -->	
       d,    s, g, p  <-- (f)   	  m
       d,       g, p      (f, s) -->  m
       d,       g, p  <-- (m)	        f, s
    m, d                  (g, p) -->        f, s
    m, d              <-- (f)	           s, g, p 
          f               (m, d) -->           s, g, p
          f           <-- (m)	     d,    s, g, p
                          (f, m) -->     d,    s, g, p
                                      m, d, f, s, g, p
    

    captcha: bling

  • Ken (unregistered) in reply to aardmoose
    aardmoose:
    Oh boy... this is a fun day.

    so...

    let x = .999... 10x = 9.999... 9x = 9 x = 1 ...

    Believe it or not, I have seen people argue that 10x is not "9.999..." but rather "9.999...0", and claim that there is one less "9" after the decimal point than in just "x".
  • Ken (unregistered) in reply to Shim
    Shim:
    <lament>Why did they ever lower the mathematics standards for computer science?</lament>

    Try this.

    What is 1/11? (answer: 0.0909, repeating) What is 10/11? (answer: 0.9090, repeating)

    What is 1/11 + 10/11? (answer: 0.9999, repeating)

    As a fraction, what is 1/11 + 10/11? (answer, 11/11, or in simplest form, 1)

    Captcha: dubya (how appropriate)

    The problem here is that the people who say 0.999... is not exactly 1 also say that 0.333... is not exactly 1/3, and 0.090909... is not exactly 1/11, and so they reject your arguments based on the same flawed reasons.

    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".

  • (cs) in reply to Adam Z
    Adam Z:
    Everyone should guess the same color. Statistically, at least one hat would be that color in a group of 3 or more.

    captcha: wigwam Although flim flam is more appropriate for the topic

    See, you would fail the interview, because that's not just wrong, but completely stupid. You didn't even read the question.

  • pb (unregistered)

    Frayed knot: d, s, g, p <-- (f) m state is now d, s, g, p, f

    f+d ftl

  • Ken (unregistered) in reply to Flash

    [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

        h = sqrt(3)/2 * l

    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/nhtelegraph-2003-11-26/ with some more information. A "Rouleaux triangle" won't fall through. However, this is not a polygon, but a rounded "triangle-ish" 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.

  • (cs)

    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.

  • Ken (unregistered) in reply to jmcwade
    jmcwade:
    jmcwade:
    I felt it irrelevant to consider payload since it was not mentioned.
    My bad, meant to quote someone replying to my comments on the weight of an empty boeing 747
    Is that an "empty Boeing 747" that was built for Airline A's "business class fleet", or one built for Airline B's "cattle car fleet"?
  • Ken (unregistered) in reply to Coditor
    Coditor:
    Grandpa:
    ... No communication of any sort is allowed... the players must simultaneously guess the color of their own hats or pass. ...
    ... It's not 100% simultaneous, and it's not without communication per sé ...
    So, your "solution" violates two specific requirements of the problem, and you don't have a problem knowingly offering it as a "solution"?
  • Ken (unregistered) in reply to hmmmm...
    hmmmm...:
    If I have 3 pieces of bread and I want to toast them on an old-fashioned grill, what's the quickest (most efficient) way of doing so ? The grill heats from above only (I want both sides toasted) and you can only fit 2 pieces of bread on it at a time.
    Well, there are 6 sides to be toasted, and you can only toast 2 sides at a time, meaning that an optimal solution (if it exists) would take 3 toasting cycles to complete.

    1: Toast A1 and B1 2: Toast A2 and C1 3: Toast B2 and C2

  • (cs) in reply to Ken

    [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

        h = sqrt(3)/2 * l

    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/nhtelegraph-2003-11-26/ with some more information. A "Rouleaux triangle" won't fall through. However, this is not a polygon, but a rounded "triangle-ish" 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 three-dimensional space. If we were working purely on a plane (two dimensional space) then an equilateral triangle would not fit.

  • Ken (unregistered) in reply to javascript jan
    javascript jan:
    ... His professional opinion: nobody gives a shit if some idiot drops a manhole cover into a manhole, because they're the one who has to fetch it out. ...
    I think the person in the manhole when the cover fell through might have a different opinion.
  • (cs) in reply to KattMan

    [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

        h = sqrt(3)/2 * l

    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/nhtelegraph-2003-11-26/ with some more information. A "Rouleaux triangle" won't fall through. However, this is not a polygon, but a rounded "triangle-ish" 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 three-dimensional 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.

  • Ken (unregistered) in reply to Richard@Home
    Richard@Home:
    Put on A and B, have sex with 1. Remove B, have sex with 2. Turn B inside out, have sex with 3.

    Um, nope - that doesn't work because you will infect yourself with whatever 1 was carrying. (The outside of condom B would become the inside when you were having sex with 3)

    Condom A is still on.

    The real WTF here is that I've actually spent time thinking about this O.o
    Ditto.
  • Ornedan (unregistered) in reply to matt
    matt:
    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.
    What part of the simultaneous in "Once they have had a chance to look at the other hats, the players must simultaneously guess the color of their own hats or pass." do you not comprehend?
  • Fish Basket Gordo (unregistered) in reply to Tarwn

    I had the same idea, but the original question stated that there could be no communication. Pointing is communication.

  • EnderGT (unregistered) in reply to pb
    pb:
    Frayed knot: d, s, g, p <-- (f) m state is now d, s, g, p, f

    f+d ftl

    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

  • Ken (unregistered) in reply to un.sined
    un.sined:
    There are three vending machines. Each dispenses one item per quarter. One machine dispenses apples, one oranges, and one has a mixture of apples and oranges. There are signs on each machine indicating what is dispensed, however the signs are wrong. How many quarters would it take to determine which sign goes on which machine?
    Are all three signs guaranteed to be incorrect? This answer is based on this assumption.

    (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.

  • Ken (unregistered) in reply to Ken
    Ken:
    (Note: my first attempt started with "put a quarter in each machine". However, this is a refinement.) ... Answer: it may take as little as one quarter, but it will take at most three, assuming that all of the signs are incorrect.
    And here is my further refinement.

    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.

  • will (unregistered) in reply to vt_mruhlin

    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 n-1 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.

  • Grumpy Young Man (unregistered) in reply to gwenhwyfaer

    "For myself, I couldn't understand why I would have to artificially bloat up my working by 200-300% 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.

  • Anonymous (unregistered)

    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.

  • R. 11 (unregistered)

    Okay. You have 8 quarters. One of them is off-weight. 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 off-weight 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 (A-O-A-O... or O-A-O-A...). Putting in a defective quarter still causes the opposite of what was supposed to come out (so, a chain of normal-defective-normal-normal 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 off-weight.)

    (The first one is easy. I believe I have a strategy and answer for the second one, but it's not a proof yet.)

  • s (unregistered) in reply to will
    will:
    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 n-1 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.

    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 ....} ..} }

  • Andrew (unregistered) in reply to Anonymous Coward
    Anonymous Coward:
    Grandpa's puzzle sounds like a trick. The color of your hat is independent from the color of the other hats, so seeing the other hats gives you no information. It's possible that order of guessing / passing could be used to offer information, but that's been ruled out as well by the fact that everyone has to go simultaneously with no communication. So, basically, you've been given useless information and are stuck with no better than a guess. Pick one person and have them guess wildly while the others pass, you have a 50% shot.

    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.

  • Undefined Reference (unregistered) in reply to Andrew

    This thread has convinced me brainteasers can be useful in an interview:

    1. Catch people with ego.
    2. Catch people with no reading comprehension.
    3. Catch dishonest people
    4. Possibly catch stupid people.
    5. Possibly allow intelligent people to jump out.
  • Michael (unregistered) in reply to YourMoFoFriend
    YourMoFoFriend:
    A typical question I used was "How many trips a tooth fairy makes per night". Here are some answers I got: - without a pause: "3000" - "there is no tooth fairy" - a refusal to answer a "stupid question unrelated to the position" - an attempt to estimate number of teeth lost per night by kids based on population of countries that do believe in tooth fairy
    Ideally, the tooth fairy would make only one trip per night. Multiple stops, but only one trip.
  • Michael (unregistered) in reply to Quizzle
    Quizzle:
    How can you be sure that the odd coin out is lighter than all of the others. Could it not be the case that the odd coin is heavier than the others?
    You were only asked to locate the odd coin, not figure out if it was heavier or lighter.

Leave a comment on “Job Interview 2.0: Now With Riddles!”

Log In or post as a guest

Replying to comment #:

« Return to Article