Slashdot Mirror


Tech-Interview Riddles

An anonymous submitter writes "A computer engineering student at UC Berkeley has made a comprehensive archive of riddles from technical interviews. Very challenging and loads of fun. Also useful for interview preparation."

15 of 747 comments (clear)

  1. These are pretty easy by SlugLord · · Score: 3, Interesting

    I sampled a few of the "relatively hard" puzzles... They're interesting, but they only take a minute to figure out. Am I correct in thinking that these are relatively easy, or am I being an ass and flaunting my ability to solve little puzzles?

    (In case of the latter, do you want to hire me? I live in Cleveland and go to Cornell University...)

  2. One of my favorites by Reality+Master+101 · · Score: 5, Interesting

    I used to put this one on my programming tests. It's actually shocking how many people get it wrong...

    You are writing a parser that reads a C program and translates all the variable names into new names of the form "VAR######", where ###### is an integer incremented for each unique variable name. Discuss what is needed for the case where the C program already contains a variable of the form "VAR######".

    --
    Sometimes it's best to just let stupid people be stupid.
    1. Re:One of my favorites by Reality+Master+101 · · Score: 4, Interesting

      You the man! Here is your honorary degree.

      Now, for this honorary Ph.D., answer this question (another one of my favorites):

      You have a 32 bit unsigned integer. You want it to be really reliable, so you store it three times (triple redundancy). Write a subroutine that takes three unsigned, 32 bit integer arguments, and returns a single unsigned 32 bit integer that is constructed by having the bit in each bit-position "vote" for the corresponding output bit (e.g. if at least two of the low-order bits in the passed in arguments are 1, then the low-order bit in the output is a 1).

      Hint: There's an easy, fast way, and there's a hard, slow way. I'm looking for the easy, fast way.

      I actually got this question on an interview once (and of course figured out the right answer :) ).

      --
      Sometimes it's best to just let stupid people be stupid.
    2. Re:One of my favorites by obsidian+head · · Score: 3, Interesting

      Optimize the common case, which usually is if the numbers are identical:

      ; XOR the ints, and OR the result
      (or (xor int1 int2) (xor int1 int3))

      If the result of this expression is 0, just return int1.

      Profiling of course is needed.

    3. Re:One of my favorites by Reality+Master+101 · · Score: 3, Interesting

      and done the exact same thing to EVERY SINGLE OTHER PERSON I KNOW OR HAVE EVER WORKED WITH.

      Sorry, but you just don't sound credible. You sound like a prima donna who walks around with a chip on her shoulder.

      I have seen people with five years of seniority FIRED because they disagreed passionately about a "flippant" management decision.

      And I've seen people fired because they can't get over themselves and the fact that a decision has been made contrary to what they want. And then they cry like little babies, and are finally fired because of a constant pattern of not being able to handle not always getting their own way.

      Just because you're arrogant doesn't make you always right.

      I know one person in particular who was labeled a "troublemaker" because they offered a dissenting opinion in front of senior managment during a "standards process" presentation.

      And once again, you just don't seem credible on this. I have a feeling that there is a LOT more to the story and this person's historical pattern of behavior.

      I'm not "judging" anyone.

      Oh please, spare me the politically correct "I never judge anyone" nonsense. Unless you always hire whoever is in front of you, you are making a judgement.

      I'm making a *decision* as to whether they can do the work and if they are motivated.

      Right, a 10 minute decision. Let me turn this around -- if you went for an interview, and some guy talks to you for 10 minutes, and then says "Sorry, your resume is fine, but based on this interview I just don't get the feeling you can handle this job" (assuming he was a rude SOB), are you going to feel that you got a fair interview?

      --
      Sometimes it's best to just let stupid people be stupid.
  3. Riddler by Anonymous Coward · · Score: 3, Interesting

    It's Turing complete. It weeps, it bites, it smiles and it loves. It can be made, it can be had, it can be taken. It was one, it was two then it became sixty two. It needs time, it need paitence it needs to be pruned. When time comes it needs a fourier series to make it look good. What is it?

  4. Re:TWO CONDOMS, THREE WOMEN by Elwood+P+Dowd · · Score: 5, Interesting

    Wear one condom. Wear the 2nd one outside the first one. Have sex with 1st woman.

    Remove the 2nd, outer condom, have sex with the 2nd one with just one condom (the 1st one).

    Fold the just removed condom inside out and wear it over the 1st one. Have fun with the last woman.

    Who says that you can't use "Economic engineering" knowledge on bed, :-)


    If this is the correct answer, then I would be at an unfair disadvantage answering this question. Because I *listened* in sex ed when they said that using two condoms at the same time was dangerous. It's too likely that air will get caught between the condoms. Some parts will stick and some parts will stretch, leading to two broken condoms.

    --

    There are no trails. There are no trees out here.
  5. Riddle by buck_wild · · Score: 3, Interesting

    What is:
    Greater than god
    More evil than the devil
    Poor people have it
    Rich people want it
    If you eat it, you'll die?

    --
    If all you have is a hammer, everything looks like a nail.
  6. Why College is Required for a Programmer by Enonu · · Score: 3, Interesting

    Karnaugh Maps (brought to you by CSE 120 at ASU):

    Your problem:

    !B!C !BC BC B!C
    A-----------------
    0 | 0 0 1 0
    1 | 0 1 1 1

    Answer: BC | AB | AC

    Ta da!

  7. Re:Why do interviewers use "riddles"? by MisterBlister · · Score: 4, Interesting
    If you tell me about ARP, DNS, and HTTP and you can name the port numbers and transport layers, that's fine. DHCP, load-balancing, firewalls, SSL, proxy servers, server-side processors, databases, that's all extra credit. If you can't talk about these things, you're not yet ready for a professional career in this industry.

    'this industry', meaning network admins who focus on web sites only, right? Not admins or programmers in general?

    Because I'd have an easy time talking about all of that stuff, but I know people as or more intelligent than I am that wouldn't simply because they haven't been exposed to any of that directly.

    It seems to me your question is flawed. You're asking too much about details that can be learned by any intelligent technical individual in a matter of days. Just because they don't know the answer when you ask it doesn't say shit about how good they might be at the job, especially if the job is something more than simple web admin.

  8. Infuriating,,, by Grape+Shasta · · Score: 4, Interesting
    The thing that drives me nuts is not having the "right" answer to check my answers against. Look at this one, for example:

    willywutang is hanging out on a heavily forested island that's really narrow: it's a narrow strip of land that's ten miles long. let's label one end of the strip A, and the other end B. a fire has started at A, and the fire is moving toward B at the rate of 1 mph. at the same time, there's a 2 mph wind blowing in the direction from A toward B. what can willywu do to save himself from burning to death?! assume that willywu can't swim and there are no boats, jetcopters, teleportation devices, etc.. (if he does nothing, willywu will be toast after at most 10 hours, since 10 miles / 1 mph = 10 hours)

    There's many possible answers, so how do I know if I've got the answer they want? He's in a heavily forested area, so grabbing a log and paddling out around the fire shouldn't be hard. Or he could dig a little moat, though that might not be too effective. So, is there some other, clever answer, I should look for, or am I done? Grrrrrrrrr!

    --

    "I am a cipher, a cipher, wrapped in an enigma, smothered in secret sauce" -Jimmy James
  9. Real-world questions by Animats · · Score: 3, Interesting
    • Explain why the stock market just crashed, outline the expected future of the economy for the next year or two, and indicate a general strategy for the company for this difficult time.
    • Will Microsoft's new approach to security work? Why or why not?
    • Based on recent news events, what level of effort should be applied to defending against info-war attacks?
    • Should we port to Itanium, Sledgehammer, or neither?
    • In an environment of Windows and Mac desktops, and Linux servers, what are the major integration problems?
    • How can we avoid an SPA audit?
    • We'd like to cut the load on our web site servers in half without losing any revenue. What should we do?
    • Historically, what copy-protection systems have worked successfully? Why?
    • Should we use C#? Why?
  10. bunch of riddles and answers... by mgblst · · Score: 3, Interesting

    This site contains answers to many of the microsoft questions.

    http://www.acetheinterview.com/cgi-bin/qanda.cgi ?a ction=topics&number=3

    i suppose the answer to many riddles is, look it up on google?

  11. Re:Why do interviewers use "riddles"? by daoine · · Score: 4, Interesting
    My answer:I don't know, I'd probably check a search engine.

    Funny, I had a similar interview for a question at a consulting company. It was basically another 'estimation' type question.

    My first answer was that I'd check google. They didn't like that at all, saying that they needed to be able to come up with these stats quickly, and that an employee shouldn't have to rely on anything. I said that part of solving a problem is knowing when to NOT reinvent the wheel and using information that's readily available.

    Didn't get a second interview either. Not even a phone call saying thanks for interviewing.

    Personally, I love interview puzzles and riddles. But I HATE people who refuse to accept an answer different from the one they have written down. That's not the point. An interview puzzle's supposed to give you an idea of how a person solves problems...not how quickly they solve it the "right" (*snicker*) way.

  12. Re:Why do interviewers use "riddles"? by pongo000 · · Score: 4, Interesting

    Those points are true if you're hiring a contractor to come in, do a job, and get out. They are not true if you're hiring a flexible team player who is going to handle a demanding job which is guranteed to throw new challenges on a daily basis.

    Please. Do you really think some silly-ass riddles will separate the wheat from the chaff? In a previous life, I was an air traffic controller (9 years). I was thrown new challenges several times an hour. I don't recall riddles being asked on my interview.

    I can tell you, however, that the three months of indoctrination in Oklahoma City was a head game unto itself. The point being it took three months to sort the psychologically strong from the weak. I seriously doubt a few puzzles on an hour-long interview is going to tell you much of anything.