views:

258

answers:

6

As part of our interview process, we ask candidates to complete a coding problem of moderate complexity. Some candidates seem to spend an awful long time on it and produce code that is not of high enough quality.

It can be difficult to document what "high enough quality" actually is and provide feedback that is as useful and objective as possible to unsuccessful candidates. It can be easy to spot code smells like poor separation of concerns, large methods, cut and paste coding, or basically completely ignoring the most basic OO principles. After examining the code a gut feeling is probably going to be enough for us to make a decision, but how to feed back in such a way for the candidate to have gained some positive insight from their investment of time?

Should we grade code on a 5 point scale for certain factors? What should the factors be since (eg) "maintainability" is highly important but highly difficult to measure or score...

Perhaps we should just provide a reading list that shows the principles that are important to us? (For example DDD, Patterns of EAA, or maybe a more accessible one like Foundations of Programming.) We don't want to spend too long on assembling a hugely detailed review, just enough to be fair to the candidate.

Any opinions?

Note: I have looked at the other code review quesitons on SO but no answers seem to fit our need... We are of course not looking for production ready code, just well designed.

A: 

Maybe a little harsh, but if you're interviewing coders who don't come upto scratch you owe them a quick and courteous reply so they know they haven't got the job, but that's it.

However, I suspect your concern is being driven by internal candidates? If that's the case why not spend 10 minutes going through their code and discussing how it could be improved.

MrTelly
No, not internal candidates. I just feel bad for the guy who has written two different solutions, benchmarked them, attached two documents of design notes and assumptions and still managed to write some frankly terrible code! I want to help this guy channel his energy! :)
freshr
So why don't you hire the guy and help him improve his code? Sounds like everything else is in order.
Robert S.
Unfortunately he is being hired to be a coder!
freshr
+1  A: 

Giving links to sites or books where is told how to write good code, might be best. I would give a link to the Clean Code book and the SOLID principles.

It's not your job to educate the candidates. You just need to find out whether you should hire them or not.

If the candidate is so good that his code writing skills improve from the little instruction that you give during the interview, then you should have hired him anyways. On the other hand, clueless candidates just won't learn it. Maybe you could try that you give the candidate (who failed the interview but showed some potential) some books to read and ask them to send a new application a month or two later. If they have improved substantially in that time, then they are probably worth hiring.

Esko Luontola
+4  A: 

Why not show them what you consider to be a state-of-the-art solution to the problem afterwards (optionally with an explanation of why it is good/better)?

danbystrom
Probably a good idea... I may do this.
freshr
A: 

It's great that you want to feed some information back to failed candidates as there's nothing worse than not getting a position and having no idea where you went wrong.

A grading system is probably going to be to arbitrary. What does it mean if someone scored 4/5 for design patterns - did they use a pattern wrongly or did they not use one where they should?

Unless you have a lot of failed applications then I think a couple of paragraphs written specifically for each applicant would be the best thing - it'd give some more detail of where the reviewer felt they went wrong and what they did right. Would feel more personal too.

Steve Claridge
A: 

Point them towards SO and TheDailyWTF. If they don't get it after spending some time there, then there's not much point in helping them.

ck
I see people don't like my answer, but I feel that you need to be self-learning to be a good developer, and these sites have both given me a lot of useful input to make me a better coder.
ck
You should probably have said that in your answer.
Robert S.
A: 

I assume you're paying these people for the time they spend outside the interview - otherwise you would just ask for code samples. Right?

In general, though, it's not your place to provide specific critiques of their code. Most candidates will take it as grandstanding, and your company will develop a bad rep. (You didn't get the job, and in addition, let me tell you specifically why you suck!)

But do provide a solution you think is good quality. If the candidate actually wants to learn, it will be helpful.

Sarah Mei
Why would we pay for their time? Code samples are not a good idea because there is no guarantee that they wrote them and the problem of ranking one against anoter gets even harder. We are interviewing many people and I certainly don't want to have to learn and understand many arbitrary domains.
freshr
IMO, asking candidates to complete a project on their own time is lazy. Either ask them to code during the interview, and evaluate that, or ask for code samples and do the work to evaluate those.
Sarah Mei
I actually like the idea of asking someone to write code, as long as it only takes 1-2 hours and is of sufficient complexity to utilize some design skills. If they sent the results in ahead of time then you can save everyone the trouble of even having them come in, if the code is really bad.
Dunk