tags:

views:

171

answers:

6

I'm always confused when interviewers ask me to send some sample code. How many/what files should I send in order to show them my programming skill?

+1  A: 

Its best to have a public facing project that you've posted on github (or somewhere else) that you can show them. That way they can see how you code a real application, and not just a contrived example.

You can always select a few files from it that emphasize a particular skill set, but its nice to be able to at least reference the project as a whole. Also, they can try it out and see if its any good!

dbyrne
+3  A: 

I'd suggest sending as much code as you think would take to get your point across.

If your goal is to show a competence level in a particular language, framework, coding pattern, or what-have-you, then send as many methods or source files as needed.

Consider sending a document with code screenshots, rather than code itself. Choose 3 or 4 attributes of your code that you'd like to highlight. This frames the discussion for the reader, and will give you the opportunity to markup the screenshot with comments around your implementation choices for the given attribute.

p.campbell
A: 

The answer is it depends. I generally submit an interface, along with the implementation of the interface .I also submit a class which uses the interface. So in my opinion 3 files should be good.

Yogendra
+1  A: 

I would choose something which is:

  • small (it depends on the language, but I'd say no more than a few hundred lines)
  • uses a good number of language features (including some features that are considered advanced if possible)
  • easy to figure out what it does (this in itself is a mark of good code)
  • ideally, a self-contained program
  • (obviously) very well-written
Charles
A: 

The ammount of code you send should be based on the language and type of job you're applying to. For example, if you're going to work on GUI applications which does X, try to send code that does something similar to X in the same language they use. If you have no idea how to do X, then at least stay in the GUI domain and send something you're proud of. Also, comment your code a lot more than you would do normally. It will show what you were thinking while coding and why it's the choice you took instead of another possibility.

Also you should really focus on quality instead of quantity.

afilatun
A: 

My suggestion: none. The provenance of sample code can't be verified; nor does it give you any information about how long that code took to write, how many revisions it's undergone etc. etc.

A superior solution is a programming test, or better still, having the candidate write code on-site, which not only shows whether they can write code, but whether they can follow directions, ask intelligent questions, get meaningful work done quickly, and possibly how well they can collaborate with your team.

I realize this isn't an ideal answer, given that you are the candidate, but I felt it merited mention nonetheless.

Tim Keating