What would a large project that spanned multiple files and >1000 lines show to an employer that a few individual files and a couple hundred lines couldn't capture?

  • 1
    How you organize your code, whether or not you understand higher-level architecture. – Robert Harvey Oct 3 '12 at 18:35
  • 7
    Why do you feel a 1,000+ lines of code is a large project? I would consider that a small project. – Ramhound Oct 4 '12 at 11:28
  • 1
    Are you supposed to show them some of your older projects, or are you supposed to create for free something they can sell to their customers? – Viliam Búr Oct 4 '12 at 12:48

Reason 1: Is it your own code, or something you copied?

(Mostly) anyone can copy a short piece of code from the internet, explore it, and give it as his own during an interview while being able to explain the code itself.

Doing the same with a large codebase would be difficult, since it would be easily recognized and searchable as one of the an open source projects.

Reason 2: Do you have skills to work on a large codebase?

When you give a link to a large codebase under version control, you show that you actually have the skills required to write a large codebase.

When you give a small piece of code, you are showing just that you was able to write a small piece of code. Would you be able to work on a codebase with thousands of lines?

Reason 3: Have you studied/verified your code enough?

For an interviewer, it would be easy to find an issue in a large codebase¹, and to interview you on it. The interviewer may ask if you are aware of one of those bugs, why didn't you solve it, and how do you think to be able to solve it now.

Moreover, during an interview, the interviewer can target any smallest part of the codebase, and ask you to explain it in details, to see how well do you know your own code.

¹ Strangely enough, it is not rare to see small (under 100 lines) pieces of code with one or several bugs where the code is not doing what it is expected to do. This applies as well to candidates who are writing that they have +10 years of professional experience and qualify themselves as highly skillful.

  • 4
    Only one bug in 20k LOC? That would be impressively low. I think 1 bug in 1000 LOC is more realistic - for good code. – Doc Brown Oct 3 '12 at 18:14
  • @Doc Brown: I apologize, my answer was not clear. Edited it. Thank you for your feedback. – Arseni Mourzenko Oct 3 '12 at 18:26
  • 3
    @Doc Brown: I'd settle for 1 bug in 1000 characters :) – Joel Etherton Oct 3 '12 at 20:04
  • Also relevant: in testing, as a sample size grows, accuracy of the test increases. – Jimmy Hoffa Mar 21 '13 at 15:36

Gives them a nice chunk of code that they can steal without paying you for when they discard you.

  • 2
    that's what I'd suspect would happen indeed. Same with the "requirement" I've seen at times that prospects put in several days or weeks of (usually unpaid) work before a contract is offered to "see if you fit in". Easy and quick way to get a few new hands to get bread and butter work done for free, just get several such and tell them all after a week or so that "we don't think you'd make a great addition to our team". – jwenting Oct 4 '12 at 7:33
  • How is it stealing exactly? Why wouldn't they just get somebody they already have on staff to write the code, instead of wasting that persons time, reviewing code written by random people? – Ramhound Oct 4 '12 at 11:32
  • 2
    you don't consider getting others to write your code for you in the guise of a "test" for a job they'll never get stealing? You never intent to hire those people, you just get the top 10 you would otherwise hire to build your new system for you, one module each, as a "test" to see "if your quality is good enough for us" (unpaid of course). – jwenting Oct 4 '12 at 13:23

I think it is likely that this potential employer wants to see how you would structure a larger application and is looking for whether you made use of good design principles.

You should just politely contact this potential employer and ask them yourself.

  • I'm going to turn this into a separate question, thanks. – Ryan Jarvis Oct 3 '12 at 15:41

Writing small pieces of code and stitching them together to form a coherent, bigger whole are two different skill sets entirely.

Asking for bigger pieces of code across several files is a way of testing for the latter. I.e. the employer isn’t simply interested in your “coding skills” but in your architectural skills.

  • Thanks, I'm going to turn this into a separate question. – Ryan Jarvis Oct 3 '12 at 15:42

it would show you're likely to hand their code to a competitor if asked to produce a code sample during a job interview.

  • How exactly does writting code for an interview with Company A show that you will hand their code over to Company B which is their competitor in the market place? – Ramhound Oct 4 '12 at 11:33
  • do you have several thousand lines of code sitting around, highly polished and optimised, for handing in at a job interview? No, of course not. The majority would take some code from what they're currently working on at their current job, scrub copyrights and colleagues' names, and send that. – jwenting Oct 4 '12 at 13:22

Mostly because of the verbosity of the languages. After all 1000 lines of code in Java/C# especially if over engineered do not allow to cram much functionality inside. So he just have to ask for something big enough to have at least some insight in how you work or think.

  • I didn't think of that. I was thinking more of writing a web app or service using PHP/Python/Ruby. You can create a pretty robust program in less than 1000 lines using a scripting language, especially if you use templating for html markup. – Ryan Jarvis Oct 5 '12 at 13:48
  • And the first 50 problems of project euler combined take around 100 lines in Haskell. Depends on the position and language you are applying for. But if you have request for 1000 lines in Python - better add license info to the file. – Daniel Iankov Oct 5 '12 at 16:01

In response to the comments on # of errors per KLOC, well, it sounds like we all under-estimate the prevalence of latent bugs in commercial software :) In mission-critical systems (like flight traffic control), 1 error per 100 lines of code is considered average [http://history.nasa.gov/sts1/pages/computer.html]. Per the same link, the software used on the Challenger space shuttle had approximately 1 error per 10K lines; that code cost $1,000 per line to develop.

  • I guarantee you that there is not 1 error per 100 lines in flight traffic control software. Reading your source myself, I cannot find any indicate that your claims about flight traffic control software is even true, let alone having a 0.01 error rate. – Ramhound Oct 4 '12 at 11:38

Not the answer you're looking for? Browse other questions tagged or ask your own question.