Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
×
It's funny.  Laugh.

Tech-Interview Riddles 843

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."
This discussion has been archived. No new comments can be posted.

Tech-Interview Riddles

Comments Filter:
  • by SlugLord ( 130081 ) on Tuesday July 23, 2002 @11:55PM (#3942239)
    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...)

  • One of my favorites (Score:5, Interesting)

    by Reality Master 101 ( 179095 ) <<moc.liamg> <ta> <101retsaMytilaeR>> on Wednesday July 24, 2002 @12:00AM (#3942258) Homepage Journal

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

  • by Anonymous Coward on Wednesday July 24, 2002 @12:02AM (#3942263)
    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.
  • Riddler (Score:3, Interesting)

    by Anonymous Coward on Wednesday July 24, 2002 @12:08AM (#3942289)
    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?
  • 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 :) ).

  • Incense riddle (Score:2, Interesting)

    by Anonymous Squonk ( 128339 ) on Wednesday July 24, 2002 @12:49AM (#3942459) Journal
    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?
  • by Elwood P Dowd ( 16933 ) <judgmentalist@gmail.com> on Wednesday July 24, 2002 @12:53AM (#3942479) Journal
    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.
  • Riddle (Score:3, Interesting)

    by buck_wild ( 447801 ) on Wednesday July 24, 2002 @12:59AM (#3942501)
    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?
  • by Enonu ( 129798 ) on Wednesday July 24, 2002 @01:06AM (#3942527)
    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!
  • Re:Incense riddle (Score:2, Interesting)

    by Anonymous Coward on Wednesday July 24, 2002 @01:13AM (#3942550)
    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.

  • by MisterBlister ( 539957 ) on Wednesday July 24, 2002 @01:15AM (#3942558) Homepage
    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.

  • I fully agree. (Score:2, Interesting)

    by Anonymous Coward on Wednesday July 24, 2002 @01:24AM (#3942585)
    I've hired lots of technical talent and never had to resort to this sort of nonsense.

    First, few people can walk into an interview situation and "think" at anywhere near their native capacity. Nor will they demonstate anything near those behaviors they will on the job. Unless, of course, they've had practice -- and that's "bad" from the start.

    I feel stupid employment tests/riddles/processes indicate a complete lack of honesty and integrety on the part of the Company. It's an "in your face" abuse of the power the interviewer has in the process. A hiring manager will likely speak with dozens of people for a single job, their HR department will speak to hundreds, even thousands. It's just too easy to "refine" your process into absurdity, and letting this happen is a more a sign of your own weakness in Corporate people skills, than any lacking on the part of a candidate.

    Anyway, for 'C' the only technical question I've ever asked has been....

    1) X.Y
    2) X->Y
    3) X[Y]
    4) (*X).Y

    Compare and contrast...

    Fully 50% of the best programmers (8 of 15) I've hired failed our "Corporate" tests. All of them were able to answer the above, right away. Yet, somehow, my development group is a "name brand" inside the Company.

    The ONLY thing that matters is a strong generallized aptitude, and interest, in Computer technology. The rest will take care of itself if the candidate has aptitude and as little as 30% of your specific technology or industry exposure. Fairly rare, that aptitude thing, but oh so few managers out there are skilled enought to identify it.

    So, they use "tricks", "riddles", and "magic" to give meaning what is obviously a bankrupt system of human-to-human interaction.

    Remember, most managers got to where they are because they weren't very good technically. So, they had spare time to make themselves useful in more managerial ways. Ever hear the one... "Techies just can't be managers"? Not true everywhere, but you see the jist. The critical mass of "managers" out there don't understand systems, or the technology that drives them. So they resort to clever devices in an attempt to "impress" future subordinates.

    Trouble is, if you're on to them -- they don't want you around.
  • by obsidian head ( 568045 ) on Wednesday July 24, 2002 @02:26AM (#3942768)
    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.
  • Infuriating,,, (Score:4, Interesting)

    by Grape Shasta ( 176655 ) on Wednesday July 24, 2002 @02:53AM (#3942825) Journal
    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!

  • Real-world questions (Score:3, Interesting)

    by Animats ( 122034 ) on Wednesday July 24, 2002 @03:24AM (#3942881) Homepage
    • 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?
  • by mgblst ( 80109 ) on Wednesday July 24, 2002 @04:18AM (#3942988) Homepage
    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?
  • by yason ( 249474 ) on Wednesday July 24, 2002 @06:41AM (#3943229) Journal
    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].

  • Re:I fully agree. (Score:3, Interesting)

    by sadcox ( 173714 ) on Wednesday July 24, 2002 @10:02AM (#3944027) Homepage Journal
    First, few people can walk into an interview situation and "think" at anywhere near their native capacity.

    At my current job, the interview process was very different and very refreshing. After about an hour of discussion about my experience and the skills required for the job, I was invited to come in and spend a few hours working with the project manager on a specific problem. I was paid at a very fair rate for this time.

    This gave me a chance to get out of a "interview" situation and into a "work" situation. It also gave me the opportunity to learn more about the project and the work environment at our company. I thought it was a pretty cool and smart way to do an interview before making a hire or accepting a position.
  • by BreadMan ( 178060 ) on Wednesday July 24, 2002 @10:04AM (#3944040)
    But they don't. As I noted before, all they really tell you is whether the interviewee has heard it before

    Anytime a person answers one of these questions right away, without reflection, I ask "Did you hear this before?". Most people are honest and say Yes a few lie and a few are just really smart. The really smart people shine for the rest of the interview. I'm not interested in the right answer, it's more important to see how people work towards a solution and how they react when confronted an abstract problem in an uncomfortable situation.

    Confident people with a good disposition work on the problem, even if they don't arrive at the right answer. The people you don't want to hire give up right away, become hostile, or deflect the question.

    Check our Behavioral Interviewing [google.com] for more information.
  • by Ex-Parrot ( 587949 ) on Wednesday July 24, 2002 @10:13AM (#3944101)
    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?

  • by daoine ( 123140 ) <moruadh1013@yahoo . c om> on Wednesday July 24, 2002 @10:16AM (#3944119)
    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.

  • by pongo000 ( 97357 ) on Wednesday July 24, 2002 @11:11AM (#3944504)
    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.
  • by Bodhammer ( 559311 ) on Wednesday July 24, 2002 @11:31AM (#3944627)
    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!

  • 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?

Work without a vision is slavery, Vision without work is a pipe dream, But vision with work is the hope of the world.

Working...