views:

1225

answers:

10

I've been looking for a job and landed an interview recently. They asked me to bring some code samples with me to the interview. But I've written tons of code in the past. I've used C#, MS SQL to develop web app, web services including WCF, desktop app and remote fat client.

-What kind of sample code should I bring that will show my ability in coding?
-Should I bring code from my previous projects or create a sample solution to demostrate both coding skills and archituring skill?

Thanks all

A: 

If they're not specific, bring it all I'd say. A CD can hold 700MB of data. I don't know if anyone can write 700MB of code in there career:) Just browse through it all to get an idea of what code demonstrates your skills best.

Doug T.
having over 700MB of code might belay a larger issue ;)
Jeremy B.
CD? What's that?
Mike Robinson
You've never written Java code with the associated XML files, have you? :-P
William Brendel
+1  A: 

I would present code that outlines:

  • design skills (well defined layers, separation of concern, modularity)
  • documentation skills (document what you mean, not what you do, one JavaDoc per class, short architecture/installation guide)
  • integration of popular libraries (you're not reinventing the wheel)
  • integrity (e.g. no proprietary code from a former employer)
Vladimir
A: 

Of course you should bring code that you think has a connection to the job you're applying for, i.e. network based/clustered/web/mobile/you name it. And of course it should be code that you are proud of! If you don't think your previous written code matches their criterias, you should consider writing one or two sample applications.

Björn
+4  A: 

Bring something WORKING that you can both show the source code for AND launch to the their amazement!

zvolkov
A: 

Just make sure you do actually bring it with you - I once interviewed a guy who insisted that I see some code he'd written and then started patting all his pockets before admiting he didn't seem to have it on him.

Luckily (for him) I didn't really want to see the code and hired him anyway.

anon
He was either really good, or you made a mistake.
Lucas McCoy
He was pretty good.
anon
+4  A: 

Code that is relevant to your desired position to start. Don't bring DB code if you are applying to be a UI engineer. Bring code that you are comfortable explaining, don't bring fancy code that you can't describe. If you bring something that you can't explain, they won't be very impressed.

Jeremy B.
A: 

My $0.02: In short, know the code you're presenting.

Explanation: make sure you KNOW the code you're going to talk about. I've unexpectedly found myself explaining parts of an application I did umpteen months ago to others and I had forgotten some of the reasons why I had coded things I way I did (BTW, I've learned to comment on why I'm doing something in addition to what it's doing).

Likewise, be able to explain the application as a whole. You may think you remember what it can do, but I've seen interviewees start to explain their applications and then talk themselves into a corner they can't get out of.

Also, good luck!

EDIT: Dang, Jeremy B beat me to it.

Cory Larson
+2  A: 

I recently posted an article about this very topic on my Blog and discuss a number of considerations about chosing a code sample from my perspective as a hiring manager who has looked at a lot of them.

The Programmer’s Guide to Getting Hired: The Code Sample

One of the points I make in the article that directly addresses your question is that you probably should write some fresh code for the code sample instead of relying on old work code, unless they ask for a long code sample. My reasons are as follows:

  • Your coding skills should be improving over time, thus your newest code should be the best you have ever written.
  • The code you have already written was probably created under constraints that won’t be apparent to the hiring manager. You don’t want to submit code that requires an explanation or apology.
  • In most cases, you are free to write code to do whatever you want for the sample. You rarely get a chance to choose a problem that you are good at solving, take advantage of it.
  • Your existing code was written to solve a work problem not sell your skills. Different objectives require different approaches.
  • You have a chance to write code that matches the technologies/tasks that match the job description.
JohnFx
+1  A: 

Make sure you don't bring code from your previous or current job. Bringing in code owned by your prior company can be grounds for immediately ending the interview. That code is confidential information from and it also shows that you may inadvertently leak confidential information in the future if hired.

This question is tricky because, in many cases, it's also looking to see if you are actively doing development work outside of your responsibilities at work. They want to find the the people that love what they do, and the guys who can only bring in confidential code aren't it.

Gabriel Isenberg
+1  A: 

Code that you've written in other companies don't belong to you and should not be taken to interviews for that reason. Other than that, I would bring in something I'm particularly proud of, something that you think is great work. This ensures that you're showing your best skills and you will be especially confident when presenting it, believing in your skills is an important quality for developers.

soulmerge