Is it OK to ask your company that you worked for to provide you with some code, that you did? Because how am I supposed to show my previous work to potential employers?

  • 15
    You can certainly ask. I would be surprised if the answer was anything other than "no". Nov 4, 2015 at 15:00
  • 3
  • 2
    One thing to note - most employers don't expect to see production code from a previous employer. It's often worth writing a few small utilities for yourself for demo purposes, or contributing to open-source projects, but commercial experience is usually measured by years of experience, references, and talking to you in an interview to gauge your understanding and proficiency.
    – Jon Story
    Nov 5, 2015 at 11:16
  • 1
    If you want to give prospective employers samples of your code then just write it. Presumably there is nothing that you were able to do while employed that you cannot still do when unemployed, or employed at another job. They don't care what you did for another company, only what you can do for them. Nov 6, 2015 at 22:22
  • "Because how am I supposed to show my previous work to potential employers?" -> if you cannot show it, i.e. something visually or physically, then simply say that you cannot. If you worked on, let's say, a website, you could refer to it and mention which pages/components/functionality you built. Nov 17, 2017 at 16:15

3 Answers 3


You can certainly ask. However, when you write code for an organization, they own any and all code that you write. They will most likely say no for the following reasons:

  1. You could be taking the code to a competitor so they have a more in-depth view into their competitions processes and thus give them a business edge.

  2. You could be taking the code for yourself to start your own company that will compete with your previous one.

  3. General trade secrets that could affect market value. If your company is publicly traded, let's just say Apple in this example, and you give them code that reveals a new feature in the next iPhone, that could affect stock prices for a company. I trust you're not that dumb, but who knows.

Any intelligent company would say no to this request, but it doesn't hurt to ask. This is generally why you should contribute to open source projects or have your own projects to showcase code.

  • 1
    As my other colleague which use to bring "snippets" from home to make it work. Isn't that a violation as my manager told me it's pretty ok to do so. So asking about my code is pretty ok so?
    – user15704
    Nov 4, 2015 at 15:46
  • So what's the best option to keep code with you for company you worked for apart from open source?
    – user15704
    Nov 6, 2015 at 23:58

Good luck with that

It doesn't hurt to ask, but I would be very surprised if they gave you any code.

However, your situation is common in the industry. Just be prepared to talk about what you did, what you know, how long you've been doing this, and so on.

As an interviewer, looking at 50 lines of code isn't likely to tell me much. (Yes, there are exceptions to that statement for truly terrible code)


I agree with other answers saying it is highly unlikely they will do so. However, you may have a chance if:

  • You have coded something with neither confidential information nor mechanisms which are considered strategical by the company
  • You manage to convince them to release this code under an open-source license

I give you an example: a company I worked with built a tool to replay packets, such as tcpreplay, but with additional features. It was an internal solution, and they don't even sell software. The manager of this project persuaded the company to release the tool under an open-source license.

As you are not in the company anymore, I would think it is going to be even more difficult though.

You must log in to answer this question.