52

In recent job interviews, companies want to see the source code that I've written in my previous projects, to check my skills. I would be happy to do this, but in most cases, I can't! Either I'm legally not allowed to or I don't have access to the code any more.

In a corporate environment it is in most cases unthinkable to ask for such a permission. Copying source code, taking it for your portfolio, showing it later to other companies, this is highly against any security standards of any IT company.

It could possibly work if I had the new company sign a strong NDA before reviewing my portfolio. But in a big company it is practically unimaginable to organize that, it is not a standard process. (I never asked it - I simply never considered to even ask if it was possible to take example software from my employer).

So:

  • Given NDAs and such, can we consider it appropriate asking a candidate to show source code that was created for a different company?
  • Is it appropriate to hold it against the candidate if he can't show source code (or only minimal) from a prior employer?
  • Should I ask permission to take examples of my source code to use later as portfolio reference?
  • If I do, how will it reflect on my reputation?
  • How do others handle the demoralization and frustration, that after many years of work you can't show a single line of code that you've written?
  • How to handle the situation where I need to write things over and over again, often multiple times, because I can't copy-paste from my previous project?

Extension: It is Germany. The target companies are mostly partner companies of German multis.

  • 55
    What country is this in? This sounds quite weird - in most countries it is standard practice that source code you write as an employee is the property of the employer. New employers will know this, and know that a prospective employee is not allowed to show them source code from previous jobs. – sleske Nov 19 '15 at 9:08
  • 14
    When a company asks you for some source code, they don't mean your previous employer's production code. What they mean is anything YOU thought of, planned, made and finished. Give them some of your spare-time work, side projects, open source contributions etc... – Kevin Nov 19 '15 at 15:42
  • Comments are not for extended discussion; this conversation has been moved to chat. – Jane S Nov 21 '15 at 11:55
  • @Kevin Yes, this is what I do, but these projects are constructed in completely different environments, for completely different requirements. – Gray Sheep Nov 23 '15 at 8:32
  • @MorningStar The ability to analyse a problem and find an elegant solution is not bound to the environment. You can show that you can write clean code that works and doesn't do more than it should, that's really all they want from you. – Kevin Nov 23 '15 at 8:40

10 Answers 10

66

This is a common problem, and there is a common solution:

Write something.

Make up a fake company in your head. Find a business problem it needs solved with software, and solve it. Show them that code.

Explain your NDA's and confidential information.

No one is looking for company secrets. They are looking to see how you organize your thoughts in architecture, your code practices, test harnesses, comments, etc.

  • 19
    Yes, but making something to perfect as a paid, full-time project is nearly such a resource-intensive task as a full-time project. And I will have to replay this for every project (or, for every technology) what I can do??? – Gray Sheep Nov 19 '15 at 4:02
  • 66
    If you need an excuse, find an open-source project that needs a nontrivial function written....? – keshlam Nov 19 '15 at 4:38
  • 16
    "making something to perfect as a paid, full-time project is nearly such a resource-intensive task as a full-time project". No, on a real project, there are customers, bug reports, legacy code, regression tests, build systems, company conventions, strange workarounds for unusual situations and so on. On a code sample of your own, you cut out all of that and just concentrate on delivering the minimum code required to show that you have the skills. Choose a simple, well-defined task and then show how a professional solves it. – Brandin Nov 19 '15 at 10:56
  • Comments are not for extended discussion; this conversation has been moved to chat. – Jane S Nov 21 '15 at 11:56
  • 1
    @Brandin and the guy looking at that code will think you were sloppy and not doing proper TDD etc. – jwenting Nov 30 '15 at 10:32
34

Make a small project of some sort and show them that code. No one expects you to show code that is owned by your previous employers, in fact I would be very worried if you did and I was interviewing you. Some people work on small open source projects for this very reason.

It's less the code itself they're interested in, than the way you write it.

I'm not a professional developer but I would have no trouble at all finding a couple of hundred lines of code I've done outside of any work commitments.

If you want the job you jump through the hoops. If I asked you to bring some code to the interview and you didn't, but someone else with roughly equivalent skills did, guess who I would employ? You're selling yourself to an employer on the employers terms, not whatever you feel like.... questioning their motivations for asking isn't constructive. It's a competition, give yourself all the edges that you can.

  • Do help an open source project, and make the world a little bigger and yourself more valuable at the same time. win-win-win-win (...) – Mindwin Nov 19 '15 at 13:43
  • 5
    Actually, the smaller the project the better for code samples for interviews. Nobody wants to read 500k lines of code - especially if nobody is paying them to do so – slebetman Nov 19 '15 at 15:58
  • 1
    Sometimes I keep snippets I am fond of, mainly so I can find them to use again. You could find some code you are proud of and rename any sensitive stuff. Of course, that won't help you now you no longer have access... – RedSonja Nov 20 '15 at 9:57
  • For me this solution is not valid. Let's say if you are a 10 years professional, you would need at least one full year just working full time on an open source project to have it up and running and being able to just show a bit of your skills. – Worker Oct 9 '18 at 2:18
11

Asking is ethical. Expecting you to breach an NDA is not. Complaining that you don't breach an NDA is idiotic and a good sign that this is not a place where you want to work.

Asking your old boss if there are things you can copy is absolutely fine. He will understand why you are asking. He will also understand the rules of his company and say "yes" or "no". Likely "no". Maybe give you permission to copy certain code that you have written, maybe not.

And the obvious thing to do is to write some code. Write the spec for a small task that can be solved in 100 lines of code, and write some really polished code that matches that spec. So you have something to show.

7

Those other companies don't want to see the source code of all your previous projects. They actually want to see the source code of your previous personal projects or projects that you still own the rights to.

If you don't have at least one personal project of your own, whether it's from a Hackathon or from something else, then that might raise a red flag with some of the pickier employers.

Pressing your former employer for the code is actually the wrong approach. This may reinforce the fact to the new employer that you don't have a personal project to show them, and/or that you're not capable of writing one on your own.

Update: Please don't take this to mean that I agree with that opinion. I also hate that same hoop some potential employers want me to go through. I do have code samples I wrote that I still have the rights to, but those projects are often half-finished/half-baked projects that don't even come close to the kind of projects I do as a full time employee.

  • 21
    "If you don't have at least one personal project of your own [...] red flag" A common view that I find entirely untrue. Doing a job X hours a day, then going home to do the same job for another Y hours without getting paid should not be a requirement for any position. – Celos Nov 19 '15 at 12:49
  • 7
    If anything, I'd rather my employees have other interests outside hours. Helps weed out some weirdos straight away. – Gusdor Nov 19 '15 at 13:04
  • I agree with Celos. As a developer myself and someone who is involved in the hiring process at my current company, I don't care if the candidate has no code to show me. We always ask, and we like seeing it. But we never hold it against the candidate if they don't have code to show us because it's all owned by previous employers. – nhgrif Nov 19 '15 at 13:28
  • @Celos: Surely at the minimum you should have the code you wrote in college for your final year? If it's not at the level of quality you like just refactor it a bit. – slebetman Nov 19 '15 at 16:03
  • 3
    @slebetman: I'd be out of luck there, my degree isn't in a computer subject. And even if it had been, I finished it 15 years ago and it's hard to believe that it would reflect my current coding practices, or that it could do so with "a bit" of refactoring. It would amount to writing a project for the purpose of showing, which I suppose is something you just have to do if that's really what it takes to get a job. But many people manage without: for example interviewers can ask you to write a little bit of code for the interview and not care about full projects. – Steve Jessop Nov 19 '15 at 23:39
5

The important thing for a prospective employer is demonstrate the ability to do the work for which they are hiring.

As others have said you could hand over some open source code. The problem with that is that no one will be impressed with a trivial project which took only a few hours/days to write that solves a fake problem. The other issue with this is that the prospective employer won't really evaluate your project down to the source code level. That would be a lot of time to invest. Just giving them a link to your git repo isn't very effective unless it is a really amazing, well-documented project.

If you want to demonstrate your skill, put together some slides that provide an overview of a solution you have created. You don't have to show lines of code.

Start with explaining the problem you solved and give a sense of its scope. Proceed with high-level architectural diagrams that sketch out your solution. Finally, give a sense of the implementation's key technical decisions and challenges and detail the particular tools/libraries you used. If applicable some screenshots that show the work in action are nice too. These slides will be enough to demonstrate your level of sophistication and will prompt questions which you can answer with fine levels of detail.

It would, of course, be ideal to do the above with an open-source project BUT if you're OK with the small risk you can ALSO do it for work from your previous employer. If you create slides describing work from your previous employer, simply do not distribute them. You have to keep them on your laptop and only use them live. The key thing is you aren't handing over source code and you're just demonstrating what you've done. I've never had a problem with this and it has made for some excellent presentation that have gotten me hired more than a couple of times.

3

As a current developer and someone involved in the hiring (of developers) process at my current work, let me offer a few pieces of advice...

First of all, you can expect that almost any prospective employer will ask and would like to see code from you. In fact, you shouldn't really want to work for anyone who doesn't want to see this. There's a difference between a candidate who can answer some computer science questions and a candidate who can actually write good code.

Second of all, most people who hire developers also keep their own developers under NDA. They wouldn't want their employees sharing source code they wrote but do not own with other companies, so they should be understanding when potential new hires find themselves in the same bind. If the potential employer does not understand your inability to provide them with code protected by NDA, you don't want to work for them anyway. You're not even their employee yet and they're asking you to break a contract with a previous employer that you land you in massive amounts of trouble personally and professionally. Think about what it would be like working for that company.

Third, encourage your current employer to either contribute, as a company, to the open source community, or allow employees to spend some amount of time contributing to open source projects that are relevant to the work you do. For example, while my current place of work has piles and piles of NDA-protected projects sitting in our Bitbucket account, we do also have a public GitHub and our developers our encouraged to contribute to that (and many of the libraries hosted their are used in our NDA-protected projects). Meanwhile, for a previous employer, I had to develop this library and did so with the agreement of that employer that it would be an open source library.

Fourth, when you're tinkering around, do it on GitHub. When Apple released a new language and some cool UI related features to Xcode, I made this project as a way to explore a lot of these new things. I was a learning project, but it's better than nothing. But, I also don't necessarily expect candidates to eat, sleep, and breathe code, so not having the time or the interest in working on these sorts of projects doesn't particularly bother me. But with that said, if you are looking for a job, it's probably not a bad idea to take a few weekends to work on these sorts of projects and build up a portfolio.

... because that's just what this is, a portfolio. When artists walk in to get a job somewhere, they're expected to bring a portfolio of their previous work so that the employer has an idea of what sort of work the artist can bring to the table. It will be very advantageous for your career as a developer if you have a freely available portfolio of your best work available for potential employers to take a look at.

  • Is it bad to put Source code on GITHub.com which you do for your company that pays you very well ? – anonymous Nov 19 '15 at 13:52
  • 3
    It is bad to put source code that is covered under NDA, and it is bad to be sneaky about things. It is not bad to insist to your employer that the company and its employees contribute to the open source community. – nhgrif Nov 19 '15 at 13:53
  • 3
    My current employer has no interest whatsoever to make any of our code available to anyone else. It doesn't benefit the company in the slightest. Don't even try to argue otherwise. And since I know that, they would doubt my mental capacity if I even proposed this. To insist would most likely mean that they'd ask me to work for a company that agrees more with my wishes. – gnasher729 Nov 25 '15 at 9:26
  • If that's your mindset, I'd advise getting that straightened out. If that's your company's mindset, I'd recommend you work somewhere smarter. – nhgrif Nov 25 '15 at 14:27
  • @PratikCJoshi nhgrif is right and it troubles me that you do not understand the difference between "posting" code and "releasing" code. Even if your company were very involved in open source, there would be involvement from legal among other stakeholders, and you would need to follow whatever the company's release process is. They won't be thrilled if they are held liable for code you stole and published that caused material damage. – user42272 Dec 4 '15 at 5:59
2

Setup a github account and start writing something. It almost doesn't matter what it is, just make sure it's your best efforts. When I get CVs through the door for jobs, the first thing I check is whether they have a GitHub account, the second is what they contributed to it!

If you don't know what to write (and that's a common problem), write code to solve Project Euler problems. It will demonstrate your approach to problem solving, layout, documentation etc.

  • Do you also check bitbucket? – Gusdor Nov 19 '15 at 13:04
  • No. Doesn't really appear on my radar. GitHub is where the action is. – Fortyrunner Nov 19 '15 at 15:04
  • Speaking as an engineer - 2/10, would not apply. – Gusdor Nov 19 '15 at 17:48
2

You don't need to write and show them code, at least not for most respectable job openings. You have your resume and accomplishments, and I highly recommend following the "Joel test" and only interviewing at companies where you have to write code in the interview. That is where they will verify your coding skills.

Source: jobs I got.

  • I think it is highly dependent on the industry. I could see newer and more social media friendly companies shocked you didn't have a github account. I could see older, more traditional industries put off if you included something like that on your resume and more likely to give you a test. – TechnicalEmployee Nov 19 '15 at 20:11
  • @TechnicalEmployee finance tech, 5 person startup, high tech. – user42272 Nov 19 '15 at 20:37
  • I agree having a company perform a test is a lot more useful than asking them to present code you don't even know they wrote, so I agree your approach is better. But for the OP, maybe they are trying to skim down candidates prior to a test. However, I think your advice would apply for a traditional industry and could see that putting github on your resume would actually be a red flag in some older industries that are more protective of their data. – TechnicalEmployee Nov 19 '15 at 22:50
  • @TechnicalEmployee I don't see why it would be a red flag... the fact that I've put my own code on github doesn't mean I go through life randomly putting everything I see and hear onto github, and companies don't see that. I don't understand what you mean by "traditional industry" v. I guess the newer kind. As I've said I've worked at a fintech firm, a 5 person startup that existed for a few months at the time I joined, and a traditional but young Silicon Valley high tech firm. All wanted code in the interview process at some point. – user42272 Nov 19 '15 at 23:03
  • I guess I'm thinking a company where security clearances are a concern. In those cases having an employee that is very pro-social media and pro-open source would not be the 'type' of employee they would want to hire. I am not at all suggesting folks on github lack ethics and don't understand NDAs. I'm suggesting dinosaurs who do hiring at certain types of firms would be 'scared' of an employee that represented themselves on a resume as very involved in such communities. – TechnicalEmployee Nov 19 '15 at 23:06
1

If you have worked for decades and don't have anything to show for it, you'll understand the deal you are getting as a creator in our society. Your creations have changed hands for money. You have no rights (at least none that are useful to you) to them any more.

If you actually want a portfolio to show, you should take care of not exchanging everything you create for money. Engage yourself in some Free Software projects (naturally, getting permission of your employer if your employment contracts would otherwise prohibit that). Give something back to a large community from which you most likely have drawn some profit for yourself and possibly companies you worked for.

If you do that, there will be commits you can show. Stuff you improved, stuff you wrote, fitting in larger contexts. Stuff written by you, publicly available and provably yours, and fulfilling a purpose, and being accepted by a large team which more likely than not reviews more thoroughly than most companies.

  • I've said some years (split in my carrier), not decades. The "decades" are coming from your mind, not from my question. – Gray Sheep Nov 19 '15 at 20:34
1

I can't believe everyone else missed this, BUT:

This is a TEST of your character. See, if you'll share your old company's stuff that you shouldn't, then you're also capable of turning around and doing it to the company you're applying to.

This test is used to weed out people with low integrity. Just decline gracefully. It's that simple.

  • What if I have the permission of the company? What if the boss of my company before 10 years if now my friend and I simply called him for permission and he gave me verbally? But, I also think it can be a test. But if it weren't one, it would be also too risky to do some nasty, and actually, there is no really dilemma, because I have perfectly legally a lot of source code to show. But anyways, thanks the suggestion! – Gray Sheep Nov 24 '15 at 22:38
  • I did preface my statement with "that you shouldn't". If it's all above board, no worries. – Xavier J Nov 25 '15 at 14:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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