[Pdx-pm] sample code

Kevin Scaldeferri kevin at scaldeferri.com
Wed Jan 31 14:32:41 PST 2007

On Jan 31, 2007, at 1:50 PM, Robert Shepard wrote:

> Newbie to the list here. Hi!
> A couple of times when I have applied for work, the employer asks  
> to see
> some sample code. I find it difficult to decide what to show them.
> What are they looking for?
> Are they looking to see if it conforms to standard practice, and looks
> like something straight out of an O'Reilly recipe book? If so, how do
> they know it's really mine, and not something I just ripped from  
> somewhere?

In my experience as an interviewer, I would like to see a number of  
the following:

a) Solution to an interesting, non-trivial problem
b) Follows a minimal set of best practices (use strict & warnings,  
appropriately modularized for the size of the problem, avoids common  
c) Well documented (might include an external explanation of what the  
heck this is for)
d) Readable / Maintainable (admittedly somewhat subjective)
e) if you included unit tests, you would win big points from me

> If they know enough about it to judge my skill, then they must already
> have the skill, and therefore they don't really need me.

That's certainly a false assumption.  If I could hire someone I  
thought was equal in skill-level to myself, I'd do it in a minute.

(And, doesn't this complain apply to all interview processes?)

> On the other hand, if they don't know enough about it, then what are
> they going by? Neatness and penmanship? Comment lines that document  
> the
> thing? Or will they actually install it and run it and see if it  
> works?

Yes, all of the above.

> Will a snippet suffice? I don't want to give them a fully functional
> copy of anything, because I don't want to give away the goods. They  
> have
> to pay for that. But if it doesn't function, then they will think I
> can't write code.

This is a good reason to release at least some of your code as open  

> Come to
> think of it, if the function does anything halfway fancy, I can't
> guarantee that any of my code will be portable to a foreign system
> anyhow - since the paths to any resources will be different.

Some might say that abstracting that sort of thing out into a  
configuration system of some type would be good software engineering  

> But okay, assuming I decide to give them something self-contained that
> actually does something functional, what would be sufficiently
> impressive? How fancy does it need to be? Should it hook up to  
> databases
> and send out emails and spiders and have password protection and  
> whistle
> the Star Spangled Banner backwards? Or will a simple webform backend
> that says "Thanks for your submission" suffice?

Well, if it's too big, they aren't really going to look at it.  I'd  
ask them what size program they are looking for.  Personally, I'd aim  
for less than 500 lines, but still non-trivial.


More information about the Pdx-pm-list mailing list