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

21 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. No answers to the riddles by Anonymous Coward · · Score: 1, Interesting

    Sadly the site doesn't include the answers to the riddles... Kinda pointless, like sex without an orgasm. It's not rewarding to challenge myself if I have no way to determine whether or not I was correct.

  4. 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?

  5. Incense riddle by Anonymous+Squonk · · Score: 2, Interesting

    A stick of incense takes exactly one hour to burn out. Given nothing but a lighter and three sticks of incense, how can you accurately measure 1 hour and 45 minutes of time?

    1. Re:Incense riddle by Anonymous Coward · · Score: 2, Interesting

      Light the first stick at both ends, so it will consume itself in half
      an hour.

      At the same time, light the second stick at one end.

      When the first stick expires, the second stick will have half an hour
      left. But if you light it's other end at the same time the first
      stick expires, the second stick will expire in 15 minutes.

      When the second stick has expired, it will be 45 minutes from when you
      started, and you can just light the third stick at one end to get 1
      hour and 45 minutes.

  6. 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.
  7. 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.
  8. 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!

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

  10. 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
  11. 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?
  12. 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?

  13. Re:some selected answers: by yason · · Score: 2, Interesting
    Calendar Cubes
    I like this one. You need all the numbers from 0 through 9 plus 0 through 3. That's 14 faces. You will never need 00 though, so you can remove one of the 0s. Also, you will only ever need the 3 with 0 or 1, so you can remove it from one of the blocks. The solution: the numbers 1-6 on one block, and 7-9 and 0-2 on the other. Yeah it works.

    If one has 1-6 and the other has 7-9/0-2, then how do you represent 7 as 07 (which was a requirement IIRC)?

    The right answer seems to be {0,1,2,3,4,5} and {0,1,2,6,7,8} since you can turn the 6 to 9 and vice versa. Then you can represent %02d representation of [1,31].

  14. I'm envious, my question was too easy by Ex-Parrot · · Score: 2, Interesting
    When I interviewed for my current job, I was asked a riddle. It was nothing compared to these, though. I actually got it wrong on my first try (I started writing pseudo code to try to compute an answer, wasting lots of time), but he gave me a second chance. I got it right after I realized that I hadn't read the directions carefully enough. I looked, but didn't see it either here or on the riddle site. Here it is if you're interested:

    There are three vending machines. One dispenses only Cokes, one dispenses only Pepsis, and one dispenses either Cokes or Pepsis at random. Someone rearranges the labels on the machines so that none of the machines are labeled correctly. Given that you have no prior knowledge of which machine is which and no way to open the machines, how many drinks will you have to buy to determine which machine is which?

    --
    To many, total abstinence is easier than perfect moderation. -- St. Augustine
  15. 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.

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

  17. This is what I used for interviews by Bodhammer · · Score: 2, Interesting
    I used this last year as a interview techique for Semiconductor Applications engineers - EE's and embedded programmers. I gave them about 2 1/2 hours and 1/2 hour to talk about it and then I took them to lunch.

    ------ Exercise Instructions

    Dear Candidate,

    This exercise is intended to break the monotony of the standard interview questions like "Tell me about your strengths and weaknesses." Please read this document thoroughly before you start!

    Your instructions are simple: Build something using the Lego Mindstorms Robotics Invention System and then tell us about your experience!

    There are no constraints on the simplicity or complexity of your project though you are expected to do programming as well as mechanical assembly. You are free to use the examples in the kit or the provided documentation (O'Reilly Mindstorms book) as a starting point.

    System Setup

    The computer has the Lego Mindstorms software loaded and tested.

    The firmware has been loaded into the RCX module and tested. COMM 1 is working for the IR Module connection. Batteries should be good (let us know if you have system problems - they are not part of the exercise!).

    In addition, on the computer is an additional programming system called RCX Command Center (Version 3.1) that uses NQC (Not Quite C) and a graphical interface for programming. This has also been tested and documentation is provided. You are free to use either the Lego software or RCX Command Center for programming your robot. The CD-Rom case has instructions on how to bypass the Lego Tutorial.

    Presentation

    At the end of the exercise you will give a presentation and demonstration (5 -10 minutes) of your project. Feel free to use the whiteboard and/or flipcharts for your presentation if needed. Please address the following topics in your presentation:

    How did you set about the exercise in terms of planning, architecture, and construction?

    What did you intend your robot to do and what does it really do? Why?

    What obstacles did you encounter during construction? How did you overcome or bypass them?

    What would you do different if you were given another session?

    There is no "right answer" to this exercise and there are no hidden tricks or traps. The intent is to give you an opportunity to show your creativity, learning skills, problem solving, time management, and explanation skills in a different way.

    Please have FUN!

    --
    "I say we take off, nuke the site from orbit. It's the only way to be sure."