News for hackers. Stuff that matters.
Re:The Worst Programming Interview Question by JonnieCache on Friday June 27, 2014 @10:46AM (#7954141)
Hypothetically, if when asked this question in an interview I were to reply "I'd look up the canonical solution on the internet and just implement that. I have better things to keep in my brain than linked-list algorithms, and there's no way I'm going to beat decades of phd work off the top of my head", what would happen?

Obviously it depends on the job I was interviewing for. Let's assume I'm not angling for a position as lead on a distributed load balancing layer or something.

I suppose if they're looking to see my problem solving workflow then I'd look like kindof a dick. But then, as the article points out, so would they.

Re:The Worst Programming Interview Question by vinkelhake on Friday June 27, 2014 @11:22AM (#7954368)
That's probably fine if you're going for a junior position where your job is to bang out code for designs that others have come up with.

But if you go up a few steps then suddenly the problems might not be that clearly defined and the set of possible solutions can be huge. A person who is constantly relying on Google to come up with solutions is probably not going to be that useful in design discussions.

I'm not defending the particular question, but on-your-feet problem solving is a real and valuable skill.

Re:The Worst Programming Interview Question by SilasX on Friday June 27, 2014 @11:41AM (#7954464)
I agree: the hard mental work is in recognizing that a fuzzy, client-provided problem description is merely a disguised form of a well understood problem -- ie, getting it to the point where you can google easy solutions at all.

But then in that case, the problem as given is still bad, because it gives that part away! If you want to test this ability, you shouldn't frame the problem in terms of linked lists. As another poster here suggested, you should ask something like "The customer gave a list of everyone and who they report to. How would you sanity check the hierarchy?"

That then requires the candidate to identify cycles as something they'd want to look for, and then this problem as a special case of "find a cycle in a linked list".

Re:The Worst Programming Interview Question by JonnieCache on Friday June 27, 2014 @11:24AM (#7954376)
Oh I agree. That's exactly the stuff I keep in my brain instead of linked list algorithms, which have a mathematically proven optimal solution. Remembering them when I don't use them regularly would be a waste of brainpower which could be better used for solutions to business/UX/architecture problems, which one cannot solve with pure logic.
Re:The Worst Programming Interview Question by boomzilla on Friday June 27, 2014 @11:45AM (#7954493)
I am not so sure. It's not just about solving the problem, but sometimes it's also the willingness and mentality to tackle something that's outside your comfort zone, as well as the approaches.

For example, given the loop in linked lists question, even if a candidate is not able to solve it completely, a reasonable approach would be to break the general case to more specific, trivial cases, such as: what if the loop has known length, what if the loop starts at a known location, etc. Interview questions are not binary decisions, you can learn a lot from a candidate just by seeing how they respond to a question.

Re:The Worst Programming Interview Question by JonnieCache on Friday June 27, 2014 @12:10PM (#7954677)
(Just to be clear, as this is a permanent and public record, I'm perfectly capable of doing this kind of thing. It's not really an unreasonable question to ask. I'm just being facetious because it's friday afternoon.)
Re:The Worst Programming Interview Question by _mulder_ on Friday June 27, 2014 @11:14AM (#7954298)
A great response would be to just say "hold on", whip out your phone and Google the answer, show it to them and finish up with "How long did it take your other candidates to complete that task? next..."

Point being, you're demonstrating initiative and, that old cliche, thinking outside the box. Think Will Smith in Men In Black.

Some interviewers might be impressed with your lateral thinking, others might be annoyed at your attempt to be a 'smart ass' and avoid the intention of the question. But that's always the problem with these type of interview questions, it depends so much on the expectations of the interviewer.

Re:The Worst Programming Interview Question by JonnieCache on Friday June 27, 2014 @11:17AM (#7954328)
I think it would be funnier to silently transcribe the code from the phone to the whiteboard, and then just sit back down and look at them while you wait for a response.
Re:The Worst Programming Interview Question by colanderman on Friday June 27, 2014 @12:00PM (#7954608)
My response would be, "OK, walk me through the code, show me how and why it works, or if it doesn't (code from teh Internets is buggy), fix it." Anything higher than a junior position requires maintaining code as much as, or more than, writing it.

Maybe this points to a better class of interview questions: the interviewer supplies the broken algorithm, the interviewee supplies the bugfix.

Re:The Worst Programming Interview Question by dllthomas on Friday June 27, 2014 @12:05PM (#7954643)
"Anything higher than a junior position requires maintaining code as much, or more than, writing it."

I think that applies to junior positions, too.

Re:The Worst Programming Interview Question by colanderman on Friday June 27, 2014 @12:10PM (#7954681)
You're correct, but generally when critical thing X is broken and you need it working for the customer, you give it to your more experienced devs, not the college intern.
Re:The Worst Programming Interview Question by dllthomas on Friday June 27, 2014 @01:39PM (#7955216)
True, but when I'm in a more senior position, we're less often in a situation where critical thing X is broken.
Re:The Worst Programming Interview Question by jiggy2011 on Friday June 27, 2014 @11:48AM (#7954524)
"oh, you can use google. Surely none of the other candidates could think of that"
Re:The Worst Programming Interview Question by TheOtherHobbes on Friday June 27, 2014 @12:59PM (#7954986)
The professionals use StackOverflow.
Re:The Worst Programming Interview Question by angersock on Friday June 27, 2014 @12:25PM (#7954777)
If an interviewee had the stones to try that in an interview, I'd probably have to at least give them a golf clap.
Re:The Worst Programming Interview Question by notjosh on Friday June 27, 2014 @11:21AM (#7954352)
I did something like this recently. The question was more around increasing efficiency of an algorithm though, and on top of what you said, the other part of my answer was more like "I wouldn't waste my time as long as performance was acceptable until it became an actual problem at larger scale. I'd move on to shipping other features."

It felt that they were interviewing for a computer scientist despite advertising for a software engineer.

Needless to say, we were mutually not a good fit.

Re:The Worst Programming Interview Question by alok-g on Friday June 27, 2014 @12:03PM (#7954630)
One day interviewers will realize this. Caching into your mind what's one stackoverflow away can often be an invalid optimization.

>> Obviously it depends on the job I was interviewing for.

In my experience, it often does not depend on the job. Interviewers ask such things even if the job does not require it because ... ultimately because they are not good interviewers. If you get asked the question, the best bet is to just answer it or else the interview goes downhill from that point on.

Re:The Worst Programming Interview Question by walshemj on Friday June 27, 2014 @11:27AM (#7954392)
But that solves the problem no? its like when I needed to limit a tool I wore to so many api requests in an hour I knew I needed a queuing algorithm but I don't keep that in my head a couple of quick google queries and a quick look on CPAN problem solved.
Re:The Worst Programming Interview Question by mrfusion on Friday June 27, 2014 @11:31AM (#7954409)
I tried that once and was told "we don't use freeware here".
Re:The Worst Programming Interview Question by walshemj on Friday June 27, 2014 @12:23PM (#7954764)
ah so what do you use instead of TCP/IP then :-)