Will the real programmers please stand up?
rethinkdb.com
rethinkdb.com
Note that this does not necessarily imply these people are useless in real-life tasks. It just means they are bad at passing exams.
This is why I would never get through Google's interviewing process. Some companies (like Google) just accept the fact they will throw away some possibly good candidates because of the nature of the selection process — and that's fine, as long as you realize that.
Note that I'm talking about solving problems involving abstract thinking next to a whiteboard here. The part about people not knowing the difference between cooperative and preemptive multitasking is something I fully agree with — people who do not know that should not seek a job at a company that deals with anything low-level.
Best of luck!
Would you be OK if instead of writing on the white board, I whipped out my laptop and coded the answer there in front of you? If the answer is no, I would happily walk out of the interview knowing I would not be a good fit for the company.
Not sure why that is.
Are you also self-taught, by any chance?
This is why I would never get through Google's interviewing process.
I understand that some people are bad at doing these types of tasks on the spot.
But what about training yourself to get better at working like this, by working through exercises, having friends help you out, etc?
Maybe it's unfair of me to comment because I'm not in the same boat, but surely there is a way for most people who are currently inherently bad at this class of problem to work on getting better at it, rather than just always assuming that a company like Google or Rethink would never hire them.
1. You hear "reverse a linked list", you maybe ask some clarifying questions (expected efficiency, in-place or a new list, etc.).
2. You start drawing boxes with arrows on the whiteboard.
I've never been able to come up with any algorithm for a linked list without drawing a bunch of arrows and staring at them. And while lots of people might be too stressed out to come up with the algorithm, any programmer who has even a little experience with lists should know to start with that.
In other words, if you have any experience with this kind of stuff, it shows up pretty quickly by what you do/what you say.
I'm surprised that people find writing simple programs and talking about them stressful. I find it quite enjoyable.
And also, if they don't ask technical questions, they don't have a bozo filter and I'd risk having to work with bozos.
It helps, I suppose, that I enjoy explaining things to people.
As an example, I love Haskell's type system. I will almost always try to explain to interviewers how Haskell's type system would benefit this or that problem, and how it compares with the languages they are using. If the interviewer is any sort of good programmer, we can usually get into a good discussion on the trade offs of different language features.
Of course, maybe I would be getting even more offers if I didn't use this tactic.
If someone isn't able to solve problems, that isn't something you can fix easily.
I'm tired of all these people who do poorly on tests turn around to blame the test. Everyone is nervous during tests and interviews. Those who succeed do so because they can solve those problems like the back of their hand.
Yes, but what you're missing is the degree certain people are nervous. Some people lock up completely due to performance anxiety, which has nothing to do with how difficult the problem is. Those people are also more likely to be found in the computer engineering profession due to the nature of the job.
So if you want a charismatic person with strong social skills, then you're just going to have to accept the bullshit artist who is more PR than talent over the painfully anxious and shy person who knows how to program.
That, or deal with hunting down the very few people who are both social and vastly knowledgeable. Good luck with that.
b) If you want to advance as an engineer (of any sort, I would say), social skills are nearly mandatory. People who just code well-specified problems, no matter how well, are going to be stuck at the lower tiers of the profession. Being able to talk with your customers (internal or external) and understand, and help them understand, their needs is essential to increasing your value as an engineer.
After seeing the problem, I fired up textmate and started writing C pseudo-code to do it. I started off with
first_item = l.first();
next_item = first_item.next();
Then I started writing the loop, and somewhere in there, I got confused. And then a wave of panic came over me - shit, maybe you can't do this. I shook off the thought, deleted my code, and restarted. At some point, I realised that I was always pointing at the first element. My stomach sank and I had this dreadful feeling - okay, you kind of suck as a programmer. Then my mind went blank, and I wanted to switch over and see if the answer was there.And that's with NO PRESSURE AT ALL. With someone watching me, I'd probably not even have been able to get the loop right.
I have never written such a loop, but it's basic stuff, I can do this anytime. But just a little bit of pressure made me royally fuck up.
Programming is thinking - you need to juggle shit in your head - if at the same time you are paying attention to what a HIRER is doing or saying, it will totally smash this ability to do shit in your head.
Your programming exercise probably selects for calm people, not for good programmers.
It took me around 20 minutes to write all the extra code and 9 to write the reverse function (including the testing and all).
The problem was not knowing how to solve it but more the pressure of looking at the clock and seeing the time flying away. Because of that, some minor mistakes were done and naturally you start to get nervous and waste more time. In a phone interview I would probably even do more minor mistakes and fail it.
struct LinkedList {
LinkedList* next;
int data;
}
void reverseLL(linkedList* ll){
if (ll==NULL) return NULL;
LinkedList* newList;
prev = NULL;
for (;;) {
newList = malloc(LinkedList);
newList->data = ll->data;
newList->next = prev;
if (ll->next==NULL) break;
prev = newList;
ll = ll->next;
}
return newList;
}I'm sure you could do it if you took a piece of paper and drew a linked list with boxes.
step two: tell a C compiler how to do it
(although the solution I would write first in LISP isn't actually what I would do in C; in C, I'd start with stack/cons-like linked list and do a slinky-queue shift)
The point is to determine whether you are a programmer because you think like one, or if you are a programmer because your compiler thinks like one, for you. Surely, if you rely on your edit-compile-test-hack-edit.. loop to get you through the problem, thats okay: most programmers work like this.
But the really good programmers, ones that are valuable to all sorts of conditions of development, can work out a problem pretty rapidly without needing the workflow-loop to get to the conclusion. These sorts of tests, outside the 'normal environment' in which programmers usually operate, don't really point out the programming-efficiency of the person, but do point out how much they depend on tools to be the programmer they are ..
Myself, I also thought of 3 different ways to reverse the list before I sat down to write any code. And even now, with my compiler in front of me, I'm not entirely sure there isn't some brilliant one-liner to solve the problem. I am, however, sure that once I've compiled a solution, and run it, and seen that it does indeed work, I can walk away from the problem satisfied that I at least got something working, even if it wasn't the best solution. The degree of effectiveness of my approach and my process is what is being measured, here, I would imagine, by the interviewer ..
Systems Programmers = "real" programmers (for the article's writers)
Application Programmers (or even worse, Information Systems guys like myself) are not "real" programmers to them - and to be honest, I don't believe myself a "real" programmer sometimes as well.
Given the rather adversarial nature of the technical interview setting, there's pretty much zero probability you'd actually get that answer from him.
This presents an interesting dilemma.
Interviews are a way for two parties to determine if it would be mutually beneficial for them to have a long-term relationship. They are no more adversarial than flirting or dating are.
I can write C code to reverse a linked list, or discuss the asymptotic efficiency of a bunch of data structures in my sleep... but I clearly don't have enough experience with threading if I had to google what a "condition variable" was, or had to make sure my intuitive notions about cooperative and preemptive multitasking were right.
Always nice to be reminded that you don't actually know anything.
The article says 'Because they’re part of a core body of knowledge taught in any undergraduate curriculum worth its salt, and because in some form or another, they came up in our daily work' - I can agree with asking it because of the second part of that, but I don't agree that all the questions presented in the blog post are in the category of the first part.
Easy to say it here, but would be really poor answer at an interview :)
Sounds like you're caught up in a big circlejerk, to be honest. Your interview process is terrible and that's why you aren't finding any employees. You won't compromise on your process? What? You should be less worried about your process and more worried about finding quality employees (hint: your process isn't working).
Asking people to write a program over the phone isn't going to work. Have you ever written a program while on the phone? I haven't and I'm not going to. It's so far out of my comfort level that I'd probably end up looking like a moron.
Your test sounds like it's too much about what a person knows and not enough about how a person performs. You'd be much better off looking at a persons resume and, if you're satisfied with that, just talking to the person instead of worrying about whether or not they can reverse a linked list in C off the top of their head. If you want them to write you some sample code, let them do it at their leisure instead of with you breathing down their neck over the phone.
Frankly, reading about your interview approach just kind of pisses me off. What's more likely: all the candidates suck or your interview process sucks?
Possibly nothing is worse for a new tech venture than a bad hire. I've lived through a few at various startups. It's horrible. It's the worst kind of death because its often slow and painful and you're bleeding capital.
Also realize that a bad/incompetent programmer is a NET NEGATIVE.... not just net 0!
(obviously being 'ridiculous' is subjective, and highly dependent on the roles and responsibilities of the job).
Google on the other hand actually could afford to be less ridiculous.. they just choose not to.
I've thought A LOT about this problem... so much so that my web-startup is attempting to solve one aspect of this problem (see my HN profile for the link).
Once big difference is that they require a certain amount of manpower, so they can't afford to throw away good material due to an inaccurate screening process. I guess in contrast Google can (probably?) afford to be wasteful.
"One of the interesting things we've found, when trying to predict how well somebody we've hired is going to perform when we evaluate them a year or two later, is one of the best indicators of success within the company was getting the worst possible score on one of your interviews. We rank people from one to four, and if you got a one on one of your interviews, that was a really good indicator of success."
http://gawker.com/5392947/googles-broken-hiring-process (The first quote)
And honestly those questions that they ask candidates seem reasonable for the type of work they're doing.
The numbers he is giving are very reasonable. Remember, that's 5% of the applicant pool that pass this test, not 5% of all programmers. It may be a bad economy, but the people looking for jobs are still skewed to the incompetent end of the spectrum. That might correspond to looking for the top 25% of programmers.
I wouldn't consider anyone who couldn't come up with working code to reverse a list in an hour anything like a peer, and I'd only consider hiring them for easy work if they were cheap or had some other specific expertise.
It's hard to find people that can answer programming questions while applying for programming jobs. People generally do OK on the "soft" questions appropriate for the phone. "Explain automatic testing." "What kind of editor / IDE do you use?" etc.
People generally don't do well on simple whiteboard questions, and try to BS their way through. Our questions are very simply, along the lines of: in your favorite language, write a function to: "calculate the nth Fibonacci number" (we explain the sequence if you've forgotten), "capitalize the first character of a string", "reverse a linked list in place", and so on. The people that have been good fits for our team answered these questions without trouble.
The people that hemmed and hawed and didn't get a working answer (or claimed that their favorite language already had built-in functions for each of the problems) simply didn't get hired. If people don't do well on one question, we ask more; trying to find one they can do. They usually can't do any of them.
They couldn't show any ability to program, so we don't hire them to program. It's a large percentage that doesn't show any ability, but the people that do pass the interview are good to work with. I don't think it's unfair to expect people to produce code during an interview for a job where they will be producing code. Even if you're nervous, you should be able to do a little bit of your life's work, if only out of habit. You do this every day, after all!
(Another thing I like to ask: after describing your grandiose project from your last job, tell us what you actually did. Oh, you wrote the build scripts, not the custom hardware for parsing FIX messages? That's fine, but why'd you tell us that the design was "ours" for the last 20 minutes? Did you think we wouldn't ask what you did? We're hiring you, not your entire team.)
So anyway I think we've confirmed the OP's results. It's hard to find programmers.
I have been surprised when doing interviews how many people fail the basic soft questions. I have had people saying they were senior programmers not know what automatic testing was and who did not understand what an IDE was at all. (I have also had people tell me they preferred simple text editors to full blown IDEs, but they always knew what they were doing.)
And I concur with your basic concept. Even granted the pressure of an interview, if they cannot do the really simple stuff like fizzBuzz on the board or at least get an answer that only has minor syntax issues than I would be very dubious of their ability to program seriously.
In about a dozen interviews, nobody did it. The problem was way too hard. By the end of the cycle of interviews I had started giving lots of guidance to the candidates: asking them about permutations that their solutions would miss, asking them how many permutations their solution would print, asking how many permutations a string of length 2, 3, or 4 might have, and when they got stuck, telling them what they had right and when they went wrong. Nothing really helped, though.
Perhaps it's not really so shocking. Maybe's it's just too hard in a one-hour interview. I thought it would be easy, but then again, I've never had to write code in an interview. What is shocking is how poorly people floundered. I'm pretty sure most of them couldn't have even reversed a singly linked list. In the end, I gave the best marks to the candidates who:
1. Asked whether it was okay for duplicates to appear in the output.
2. Wrote up a roughly correct (syntax errors and off-by-one errors aside) implementation of their first idea for solving the problem and explained how it worked.
3. Understood when I pointed out permutations that their solutions would miss.
4. Were a good sport about being asked to solve the problem. (Actually, nobody who failed this criteria did remotely well at the others, so it's somewhat redundant. I mention it because I was surprised that people would get crabby about being asked to write code in an interview.)
Three or four of the candidates, out of about a dozen, managed to meet all four criteria. These were people who passed a phone screen! Even worse, some of the candidates who failed one or more of the four criteria above apparently shined in their other interviews, claiming to have been in charge of designing and implementing significant systems.
I am pretty sure I nailed it. But I have been asked questions like this at interviews and screwed them up (e.g., at Facebook, which asked me something very similar and I failed to get it right). The notable thing was that at home, sitting at my desk, I wasn't afraid of sitting silently and figuring it out. It took me about 3 minutes of silence for my brain to organize itself enough to solve the problem. I'm not willing to spend 3 minutes in silence at an interview, and yet if I just jumped in I would go down a lot of wrong alleys, become confused, and screw it up.
Is there room at an interview for someone to silently figure something out, without someone waiting on you, asking to "show me your thought process"?
Frankly? No.
Not for three minutes, anyway.
That's why either (a) the permutations question is too hard, or (b) the interviewer cannot necessarily expect anyone to get the right answer, but should instead judge incidental aspects of the process. (This is what dkarl seems to be doing, and that's fine.)
If you are asked a hard question, I think it's better to steer on the side of "going down a lot of wrong alleys, out loud". Just be honest about it. If you find yourself lost, go ahead and say "oops, thinking out loud during interviews is not my strong suit and now I'm pretty sure I'm lost". Find your own bugs and laugh at them. Backtrack. Start over. Restate the problem. Sketch a unit test that describes the answer that you can't quite derive yet. Define a simpler problem that you can solve out loud, and solve that first. And, of course, always do the stupidest thing that could possibly work.
It occurs to me that the average student spends all kinds of time in school studying how to solve problems quietly and completely at one's desk, and very little time practicing the art of sketching half-baked solutions out loud while waving one's hands. But you can practice that.
You mean, teaching?
A common thought process might go something like this: inchoate thought; more structured visualizations and vague search over solution space; enough insights have accumulated; convince yourself that the solution is correct; nail down details. It's an additional skill to provide running commentary to strangers during this.
The permutations problem -- which I've encountered and did fine, FWIW -- may be a poor question for most projects. I imagine only few require much thinking along those lines.
1) Do it recursively like permutations(xs) = [[x] + p for p in permutations(xs - [x]) for x in xs].
2) Systematically generate all combinations of letters, only print the ones that are permutations of the original.
3) Systematically generate the permutations in lexicographical order.
All three would require pretty significant effort to get correct on a whiteboard in a language like C (without high level list comprehensions & operations).
> write code, in any real language (i.e., not pseudocode,) to print out the permutations of a string
Choosing C would be a pretty big fail, though honestly, people didn't struggle much with language issues. I told them it was fine if they didn't remember exact APIs, and nobody got to the point where they were worried about whether the code would parse. One guy did it in C++ using the string class, and I don't think he was at a big disadvantage. It's (evidently) harder to figure out the details of the algorithm than to write out a solution in C++.
Did any of the candidates use Python or ML or Haskell? What is the reason they didn't get it right?
It may be harder to figure out idea of the algorithm than the implementation details, but in my experience you often won't even think about the high level algorithm if you are in a C++ mindset, you'll only think about swapping letters around.
Actually conceiving of the solution was the roadblock for most, but the ones who got past that struggled to figure out the recursion -- what should be the signature of the recursive function?
Pipe the result through "sort -u" if you don't want dups.
There's your problem! You are asking people to simultaneously (1) design a divide-and-conquer algorithm, (2) write syntactically-correct code on a whiteboard, an unfamiliar mode of writing for most people, and (3) give a comprehensible oral presentation, which creates a lot of social and emotional pressure for many people. Distraction is the death of reasoned thought.
Break the interview into single-purpose phases. (1) Help them write down a clear description with some examples. (2) Have them cook up pseudocode or diagrams of how to solve it, with review/debugging from you. (3) Have them write code. (4) Have them explain why it works.
As for being crabby, probably a few of them saw, but could not articulate, that the micromanagement set them up to fail. They should handle it better, but it's understandable. If you want to evaluate their willingness to graciously write code, start the interview with a dead simple FizzBuzz style challenge. E.g., write a function that takes an array of integers as input and copies them to an output array in reverse order. Specifically tell them they can ask questions or ask for help, but need not explain anything, that the code will speak for itself.
Besides, where else do you get to work on problems like that? But judging by the other responses on this thread, my idea of fun doesn't seem to be widely shared.
I've always thought that their choice to post those salary numbers was a bit foolish. Far better to negotiate a low-ball offer for an experienced candidate after selling them on your company during the interview, than to have them avoid interviewing at all because your salary ranges are fixed and low for the industry.
I think you're assuming too much about the data on Glassdoor -- it's not necessarily reliable or precise, especially for positions that require experience. The numbers you'll find there are rough guidelines of average salaries for people who are willing to post to glassdoor. That set is not necessarily representative of software engineers as a whole.
I can say that GlassDoor's data for the jobs I am currently familiar with seems fairly close to my own observations.
$125k/year is what you would give to a decent coder with 3 years of experience. At Rethink, it looks like they want to pay him $80k/year. Some people will take the job just because the company and problem domain looks fun, but not everyone will.
You're living in a dream world.
Please understand that I am not making any statement about whether talented programmers are worth $125K/year - I am simply reporting what I see on the ground.
But it's important to note, I'm not talking about the average developer here. I'm talking about the top 5% who think "reverse a linked list" actually is a warmup question, and can maybe even explain how a binary tree speeds up finding ordered objects.
Something of a tangent, but a lot of cool kids don't work in the USA and have no intention of moving. I know a dozen or so people here in Bangalore who'd breeze through these questions. The flip side is of course that I can think of only a dozen or so people and this in a city (Bangalore) with tens of hundreds of thousands of "programmers" in it.
Write a function in C (on the whiteboard) that takes an array of integers and returns its sum.
I explicitly explain to candidates that this is a warm-up question to start the interview, and that I'm looking for the textbook solution, no tricks.
The advantages are: 1. It takes a reasonable candidate 3 minutes to write down the answer. 2. Answering a question correctly gives them confidence, always important in an interview. 3. It provides a good basis for a little advanced discussion (overflow, speed, error handling, supporting infinitely large numbers, etc).
Amazingly enough, some candidates have actually failed this...
If an interview is like dating/flirting then you don't start by asking the prospective partner about their life philosophy you start by talking about the weather.
"Amazingly enough, some candidates have actually failed this..." - that is just sad.
Your best bet is to recruit in Russia/Eastern Europe/India/China.
Edit: before I get downvoted into oblivion, I didn't mean this disparagingly, I am just being matter of fact. It will be easier to hire people from those countries. Most Americans who do this work already have a job. Most Americans looking for a job, don't want to do this, or don't know how. I have worked with guys from Croatia who helped write some database driver code for me and were excellent.
No need to denigrate folks who do (or don't do) this kind of programming. Its just the difference between an applications programmer (who codes state-transitions for large state machines) and system programmers (who create those libraries everybody else uses).
There's at least one other place you can get competent people who know about the fundamentals: academia. This is why Google tries so hard to lure people from academia.
Some people, maybe most people, can't be bothered to deal with the hassles of lower level work.
Myself, I don't have to re-invent every wheel in the world, but when I had a web dev job I found I had gone a year without actually writing anything but glue. For people like me, the feeling is "what's the point?" Don't ask me why the finicky lower level stuff is any different, but for me, for some reason, it really is.
Of the questions / problems expressed in the article, I think I have a decent grasp of most of them, and I don't program in C or language with similar ideas. I did learn with C (and then expand that knowledge to C++), but that's been a long time ago. To not be able to traverse a linked-list, though, that baffles me. Simply shouldn't be appling for a job programming in C or C++ and not understand linked lists.
Obviously you gotta traverse the thing at least once.
Anyway, I misread "traverse" for "reverse", hence my incredulous comment.
Perhaps traverse means different things to the two of us.
For this type of problem, it also hints at your understanding of indirection and pointers as opposed to stack allocated values, etc. Pretty much a pre-requisite if you're doing anything remotely performance-critical, like rethinkdb is. When you're dealing with a higher level language, that's all abstracted away by references.
But I do think you should realize what type of programmer you are looking for. Most of their questions mentioned assume a knowledge of C. I have not used C since high school, even in college it was optional for CS majors, and a lot of programmers majored in things other than CS (I started in math, I know another truly good programmer that started in nuclear physics).
This is great if you are looking for C programmers, but I would not consider them basic things any developer should know.
My first thought was to build it up again from new conses, as you would in lisp. But then spotted a neat in-place way to do it too.
Found I absolutely had to draw a few scribbly diagrams first though.
1. copy head of list consed with nil
2. copy next item consed with previous
3. goto 2 while next item is not nil
That's N*(cost of a copy and a cons). Granted, it's not as fast in absolute terms, but the slowdown is a constant factor. You're certainly not doing N operations on each item.So in C, always in place unless explicitly specified otherwise.
Thanks
It bugs me that no matter how much I practice programming and know my stuff, my application might get glossed over in favour of some non-programming douche with an immaculate CV.
it was only after completing their warm-up problem that I realized that wasn't the case, and that in order to have access to any of the other programming problems (ie, in order to get to the fun stuff), I'd first have to set about finding an employer who has signed up with their service :(
But then again, my course work included a course in operating systems where the main project was to write the multi-threading architecture, system call infrastructure, virtual memory, and file system for a bootable x86 OS. I went to Virginia Tech but the course's origins is Stanford.
Best class I ever took.
Although now that I look over the listed courses, I don't see a senior level OS class.
Although, the only ones that would take it now would want to.
Computer Systems still introduces many of the concepts that OS does, it's just done from the perspective of user-land, not kernel-land.
I don’t get all the people saying that most people can’t code under the pressure of an interview. What’s the big deal? It’s one function. I have certainly been asked technical questions in interviews, including to write code on a whiteboard, and it’s no big deal — I have missed a bracket or two, or been slightly off, but if it’s 95% right that’s good enough for the interviewer.
I’m not Mr. Cool, either. Finals, deadlines, and papers all really stressed me out in school (mere months ago). I can just code alright and I understand the tech.
I just don’t get it.
I also don’t understand what the alternative is: just take people at their word they are great programmers?
We've had great success giving candidates a week to design and implement a small application from end to end. It really let's you see everything all at once. Can they design? Good comments? Good data structure selection?
It's the best of all worlds. The candidate has time to really show off their ability, you'll get a much more holistic view of their skills and it puts them equal footing with the interviewer because they've had a lot time to think about the problem. We found that whiteboard coding questions tend to favor "geek jocks" that are really just good test takers.
I’m not so sure about "geek jock" but I do happen to be a good test-taker. (I assumed most nerds were, though.)
And I'm not a coding genius. I don't particularly like being put on the spot. I've had problems coding before (personally) and just had to go away until the problem magically became easy. Under the pressure of an interview, that kind of lockup would be disastrous.
So it sucks, but apparently the industry is in a place right now where a lot of less capable people have resumes that suggest they can do the jobs for which they are applying to.
I object far more to the presumption that some company can waste my time for two days of non-stop interviews than ask me to code up some problem for them.
I probably spent five minutes at most working out a reasonable way to do this in-place with a single pass, but spent 20-30 minutes reassuring myself that I had it right for all cases.
These kinds of problems are always interesting to me: they have simple and obvious (after some thinking) answers, but probably aren't something you've touched in a significant amount of time, because nobody reinvents the wheel like this day-to-day. They're very satisfying in a "back to basics" kind of way.
But specifically when it comes to asking for the Github url (or the like): that assumes that the code they have worked on is open source. There are plenty of good hires out there that may not have participated in open source but still have plenty of code they've created. I think asking for a public repo is too heavily weighted towards open-source wonks.
I'm content asking the candidate to point me to something they've created. I work on webapps so presumably for the candidate that would be a public facing website. And then i study it. And then I grill them hard on the details of their implementation.
In addition I find git to be fostering bad habbits (no default push of private branches), and github to be an abomination (stuff that relates to my code and source control should not be accessed in a 3th party website, but in the tool itself).
It seems (to me) that more important than this question is knowing when to use one data structure over another (pros and cons) is more important than being able to manipulate one specific data structure during an interview process.
It's a good one. I have an awesome follow-up to it that it sounds like your interviewees would never get to anyway :-)
void reverse_list(head) {
struct node* current = head;
struct node* last = NULL;
struct node* next;
while(current != NULL) {
next = current->next;
current->next = last;
last = current;
current = next;
}
}(aka, Java coding is tasteless)
The language isn't important here, it's knowing the algorithm and being able to put your ideas into code.
You could ask the same exact question in Java and you should be able to get the same answer from people.
> reverse [1,2,3,4]
or if I couldn't use the Prelude (yikes!) reverse [x] = [x]
reverse (x:xs) = reverse xs ++ [x]
> reverse [1,2,3,4]
The problem is that linked list traversal is a solved problem. Why not throw a novel and interesting problem at candidates? That way you could gain some insight into how they go about solving problems instead of how good the candidate is at memorizing other people's solutions that they could just as easily look up in a search engine in a few minutes.Sitting there putting pressure on the programmer working is just a prick move. If you gave the same test to a carpenter and asked him to build a bird house and the outcome would decide whether he could pay rent this month, he would cut his damn hand off. Guaranteed.