views:

641

answers:

6

I recently applied for a developer position and the director there asked me to send some samples of code.

How should I approach this? Once, I sent a sample of code that I wrote for myself to a company and they didn't get back. This time, I want to be prepared and send appropriate samples. I want to know what I should send them, create a sample website/code it and send a link along with code files, or create a sample project, or some other approach. I cannot send code that I have written for my previous and current employer, so I'm not sure what to send. They asked for C#, HTML, CSS, JS, SProcs, triggers samples, so I thought: would it be nice if I create a project that includes all the above and send it to them, or should I send individual samples?

A: 

I'd take something I already worked on - preferably three-tier including sprocs, etc., and factor out anything of a sensitive nature. If it's something you wrote yourself then you will be comfortable discussing it and able to show the breadth of your knowledge - that's what will land you the job. A complete project shows that you know how everything fits together. One more thing: if they ask you where you go to find good code samples, do not immediately say Google: tell them you would look in their code base ;-)

IrishChieftain
+4  A: 

You've pretty much answered your own question. Why not create a project including all of the above? Small games are fun to write and you can demonstrate a lot of knowledge by creating one. Websites are good too, if you want to demonstrate things like good UI design and dynamic HTML and scripting knowledge.

It's essentially your portfolio to demonstrate what you're capable of, so apply all your knowledge. This includes not just what the program does but also how it does it -- good choice of algorithms, code architecture, proper naming of variables and appropriate comments, etc.

You can write code that's of just as high quality as what you'd create for an employer -- higher, in fact, since you have complete control over the methodology and standards used. Install one of the free revision control systems (git, mercurial, subversion etc), use bugzilla to track your bugs and todo list, and write a full suite of unit tests. Produce professional documentation and demo screenshots.

Yeah, that's a lot of work. But I can guarantee you that if such a project crossed my hiring desk, I'd have you in for an interview in a hot minute.

Ether
If one of those projects crossed my hiring desk, I'd immediately assume that it was the work of a plagiarist, and they wouldn't get the time of day. One caveat, though; in the case of open source software, this doesn't apply, and this sort of thing would warrant an extensive further look. Along with verification that the candidate was the author, of course (but that sort of thing is simpler with open source).
McWafflestix
Building a personal web site using the skills you want to market to prospective employers is a good advice. Then refer your prospective employer(s) to it as a reference. I also recommend concentrating on doing a few things very well as opposed to showing off everyting you know. You can easily demonstrate that you are not a plagirist by encouraging prospective employers to interview you on the design and technical aspects of the site.
NealB
@NealB: it's not a bad idea, and I'm sure it'd work well. I don't think it should be a strict requirement, though.
McWafflestix
@NealB: also, it's not always viable for every type of project. Building a website is fine if the skills you want to market are web development skills, but what if the skills you want to market are AS/400 programming skills? Embedded device skills? DICOM skills?
McWafflestix
+6  A: 

I've been in this situation before, and I usually just refuse to send them the code samples.

The reason is this: when I work for an employer, I'm working professionally, and the employer has exclusive rights to all the code. If I tried to copy the code and send it to another potential employer, I'm at risk of major intellectual property theft. On the other hand, if I create some code for my own use, it is by definition amateur code (even if produced by a professional), and doesn't have the same level of project management stricture, test stricture, etc., and is therefore not representative at all of my professional coding skills.

Companies that ask for this are effectively asking for the impossible. I find it best to point this out to them.

McWafflestix
I would say "no" too
gbn
That's not really what the OP asked, though -- he asked what kind of code samples would be appropriate. Clearly it would be a violation of the standard NDA to send a prospective employer any code that belonged to someone else, but there's nothing stopping you from writing something new.
Ether
...and there's nothing stopping you from writing something new that's of high quality.
Ether
I don't have to take more than 30min to prove your skills and if any one refused when requested to give a sample of their skills when I'm recruting that would be intepreted as "I can't be bothered" which in my books equals "not good enough i.e. no job"
Rune FS
@Rune FS: in your answer, you said "in front of me". Quite different to asking to *send* code
gbn
@gbn: exactly. I'm more than happy to demonstrate coding skills in an interview. Interviewers asking me for code samples, though, are asking for either my professional work which is not mine to give away, my amateur attempts which are not representative of my professional work, or plagiarized code off the internet. None of which is properly representative of my skills. In particular, the only real way to determine that code samples sent aren't from the internet is through extensive questioning of the interviewee about the code, which is time better spent just actually interviewing them.
McWafflestix
@Ether: the situation is similar to you asking the interviewer to prove that the company can pay you if you get hired by revealing all of their financial information to you. They probably don't want to do that, rather assuming that you use the (hopefully obvious) fact of their facilities, employees, etc. as a guide to their continued ability to pay you; that is, you are expected to use inferred data about their success to determine whether they can meet your needs as an employee; the same way they must with employees, by using inferred data.
McWafflestix
@McWafflestix: I strongly disagree. What's the difference between a programmer submitting a portfolio vs. an artist submitting a portfolio? It's not reasonable to insist that the company take it on faith that you can code. It is quite possible to give a concrete demonstration of programming skills, and so it is not unreasonable for the interviewer to ask to see those. Submitting a portfolio is just providing a more lengthy example of coding skills than writing code in the interview itself.
Ether
@ether: I see your point, I just disagree. I've interviewed enough people who had impressive resumes but couldn't tell me what polymorphism was to know that the paperwork or other information provided by a candidate is effectively useless; I need to see how the candidate's knowledge in a practical sense. Another way of putting it: what if the candidate has a GREAT portfolio of code (or art, following your example), and you hire them based upon that, only to find when they're on the job that it was a legitimate portfolio, just that they generate very good code (art) extremely slowly?
McWafflestix
Well sure, you need to combine it with an interview to confirm that they're not just lying through their teeth :) but it's one more data point that can be used to gauge a candidate's skill. (Re speed, coding during the interview can help with that.. I once interviewed a candidate who looked great on paper, but took over an hour to solve a fairly short programming quiz in the language of his choice (some candidates were done in <10 minutes).
Ether
@Ether: yeah, I've had those candidates too. Disappointing. My sole point is that the interview is the source of the useful information; as such, I'm highly suspect of anyplace that wants candidates to submit code samples. It's an "interview smell", as it were.
McWafflestix
If one of my candidates doesn't send the requested code, they're dropped from the process immediately. If you are a real programmer, you've got *something* to send.
Rex M
@RexM: I'd suspect you're missing a lot of good candidates. But it's your call as to what you consider important.
McWafflestix
A: 

WHen I intervoiew people I often ask them to give me some code. Usually I asked them to code infront of me though but I guess my point would be the same if the send it to me. I don't look at what they've done (the functionality) but how they've done it. What design principles guide their work. How tidy is the code. What's their test strategy. Have they used any patterns and if so are they used in a well thought way. Depending on the language I'd look for specific aspects of the language. In c++ I'd love to see them be capable of using template specialization elegantly (E.g. for traits/policies) in c#3.0 I'd look for propper use of lambda expressions, generics, LINQ I'd be looking for both correct use as well as over use.

Hop it gave you an idea of what kind of scrutiny you might be put through

Rune FS
+2  A: 

Well, how about pointing them to the great answers you have provided on SO?

Sinan Ünür
...and demonstrating how much time you spend there rep whoring and admiring ponies
gbn
I really like this one. :-) Actually, has anyone actually used SO as a good reference, or has anyone hired anyone doing that?
McWafflestix
@McWafflestix isn't that what the *careers* web site is attempting to test?
Sinan Ünür
@Sinan: excellent point!
McWafflestix
@gbn: better that than demonstrate how much time you spend admiring rep and whoring ponies! :-)
McWafflestix
well, don't be surprised if they ask you "how much time do you waste on such activities?"...lots of people think that way.. and only few developers volunteer to provide free ans and are willing to continuously learn...
PRR
A: 

Besides what you send them (a project, a website), I suggest you also give some thought as to what you want to convey with it, and give a written introduction to the sample: why you think it's an interesting piece of code? What does it showcase? What pieces are you proud of? What were the challenges?
They should be able to figure that out themselves, but there is no harm in helping people see what you want them to see...

Mathias