After a good telephone conversation with an IT recruiter, he asked for sample C# (software) code of a project of my current employer.

Although this is a logic question, it is impossible to send code of my current employer. As an alternative I created a C# sample class library which shows off my current programming skills. I focussed on:

  • readability
  • documentation
  • modularization/encapsulation

After reviewing my sample code, the recruiter asked for more code / projects because he claims the current code is not enough to make a judgement.

I am pretty sure the code reflects my current skills. The question is: should I send more code or stop with this recruiter?

  • 18
    If you want whatever job the recruiter is offering you then you need to jump through their hoops. If there is plenty of work around then move on.
    – Loofer
    Commented Jun 14, 2016 at 10:10
  • 135
    No matter how dearly you want the job the recruiter is offering you, you can't just give them code you wrote for your current employer. If you're ok with exposing yourself to criminal charges, there's more lucrative employment options than writing software for a different company. Commented Jun 14, 2016 at 15:05
  • 29
    You do not have the right to give away code which you have been paid to write, your employer gets the intellectual rights to that. This sounds incredibly dodgy, in all honesty. It sounds like industrial espionage. If it really is a recruiter, and they don't understand that, then they need to learn a lesson when you vote with your feet. Walk away from this recruiter.
    – AJFaraday
    Commented Jun 14, 2016 at 15:55
  • 9
    Have you explained that confidentiality and IP rights prevent you from showing them code that you wrote for a previous employer, and do they seem to understand that?
    – A E
    Commented Jun 14, 2016 at 17:04
  • 16
    Recruiters are a curse on humanity. At best they are a potent symbol of market inefficiencies, but the reality is they usually introduce inefficiencies and obfuscation for little benefit to either party.
    – Flexo
    Commented Jun 14, 2016 at 22:00

10 Answers 10


One of the thresholds for stopping with a recruiter is are they honest, can they be trusted?

Ask the recruiter if they understand/know what is wrong with providing code from your current employer (don't even mention about the legal implications). If they are dismissive about your question or do not see anything wrong with it, then I would recommend stopping your interactions with them. If they cannot see anything wrong with looking at a company's code then they cannot be trusted with larger and more important things like finding a good job for you.

As for your sample code, unless they can explain and articulate what they want, then it sounds like you are dealing with essentially a customer that does not know what they want. At which point you can decide if you want to keep blindly expanding your test API and hope it meets what they are looking.

  • 12
    A good way to phrase this question would be "Would I encounter any issues with providing you with my current company's code?" Let it be open but don't give off the hint that you you already know it is outright illegal.
    – Nelson
    Commented Jun 15, 2016 at 0:31
  • 21
    @Nelson I wouldn't try to give an impression that I were clueless about something like that...
    – hyde
    Commented Jun 15, 2016 at 4:21
  • 7
    @Sempie: thing is, we know we're just playing the innocent but the recruiter might think we're sincere. If I had an employee who, on being asked to give company code away, asked the person who asked them for the code whether that's OK or not instead of me, then I'd consider that a serious error of judgement on their part regardless of them not being a lawyer. So by playing dumb we'll catch out bad recruiters, but we'll give good recruiters a bad impression. So we need a plan to mitigate that risk, rather than just playing dumb. Commented Jun 15, 2016 at 10:53
  • 5
    Why play games and pretend you don't know whether you can share the code?! Just be completely clear that your employer does not allow you to share code, and work with the recruiter to think of a solution. Commented Jun 15, 2016 at 11:53
  • 2
    Is it not more possible the recruiter asked for sample code/work, and the OP took that to mean their current employer's code, when in reality they meant any sample code OP has written recently? Perhaps the OP has no code written outside of work (which will not bode well for many jobs which want to see some examples of code).
    – SnakeDoc
    Commented Jun 15, 2016 at 15:36

Explain the situation to the recruiter - tell them that you do not work on any projects outside of your current employment, and as such you do not have ownership of any code that you can share without breaching copyright law, confidentiality agreements and your current employers trust.

Ask them if they would be willing to set you a short technical test in the form of a trivial problem to solve, the resulting code for which will demonstrate your abilities at their current level. Most recruiters should be willing to do this if they are asking for code examples.

In future, find something that you want to work on as a personal project, and maintain it in a Github account - that way, you have a ready made set of samples that you can legally share, and also it allows you to develop in directions that your employment might not allow (eg other technologies, methodologies, gives you the freedom to polish code beyond the level your employer will allow etc etc).

Your Github account does not need to be public, but it does help if you want to broaden your exposure amongst recruiters - it shows that you are not afraid to show off your code for all to see (which can be a pain at times, but unless you are working on something you don't want the world to know about, the benefits outweigh the issues).

One final thing to be wary of - ensure that any code you do expose in any means to recruiters or the public does not include any passwords, API tokens or authentication tokens. You would be surprised how often these things leak through source control...

  • 7
    It's not necessarily about wanting your code to be a "secret". My side projects are a few small Android apps, which, while a hobby, I am trying to commercialise because I do like free money. I don't have any desire to make them open source.
    – Davor
    Commented Jun 14, 2016 at 13:50
  • 3
    @Davor I never said "secret", I said "you don't want the world to know about" the intention of which at the time I wrote the post was to include commercial code. That is the sort of code base that I wouldn't be showing to recruiters anyway - the point of maintaining some public GH repositories is to show that you have code which you are not acting as gatekeeper over, so you aren't picking and choosing choice snippets of code which to show off, but rather embrace good code across entire codebases which you have no issues with people looking at.
    – user34687
    Commented Jun 14, 2016 at 14:26
  • 1
    In addition to this: sceptics who mention that a recruiter will not know C#, seem to forget that hey may be cooperating with someone. And also if I were asked to judge someone by their code, I would be hesitant to do so based on a tiny piece of perfected work. Commented Jun 15, 2016 at 11:51
  • 1
    @DennisJaheruddin That's what a technical interview is for. This is a scam, as evidenced by the fact that I could submit code written by a friend of mine and you'd be none the wiser. This is an attempt to get either company secrets or free consulting. Either way, SCAM. Commented Jun 15, 2016 at 12:48
  • 2
    @RichardU a technical test does not preclude a technical interview - I give my candidates (in recent jobs I have done hiring of software devs) technical tests, and if they pass that then they are invited to a technical interview where we have an indepth discussion around their solution, so not only do they have to submit non-trivial code, they have to understand it as well. It makes for some interesting conversations.
    – user34687
    Commented Jun 15, 2016 at 12:52

From professional recruiters I know, recruiters typically have no claims to knowing "talented" C# writer is. Sounds like a scam or worse to me. No way that a recruiter actually has the time and know-how to make such educated guesses as to the exact level of expertise.

Or does he or she specialize in C# before you came along? And if so, why does he or she really need to see more code if fundamentally the person has plenty of experience at reading competent coding?

Scam. And stupid. Asking for company coding...you oughta report that bum before he steals other people's stuff.

  • 3
    I agree. It sounds like the recruiter is trying to get some free code. Commented Jun 14, 2016 at 15:47
  • 3
    Could be, but I know a recruiter that does have that know-how. They employ programmers and use them to offer some services to potential employees as well, one of which is to decide what skill level someone is. Of course they do this because they know the value of good programmers to employers.
    – aross
    Commented Jun 15, 2016 at 11:07
  • 1
    Maybe the recruiter asked the development team their thoughts and they said to ask for code? As a developer I have suggested asking for code, those who develop in their spare time would have no problem sharing code and are usually better developers anyway.
    – Drakarah
    Commented Jun 15, 2016 at 16:33
  • 1
    Company code, though. Imagine asking a Coca Cola scientist invokved in the creation process to see some of his company work. Unethical, if you ask me.
    – clifton_h
    Commented Jun 16, 2016 at 2:24
  • May be more than a scam--may be industrial espionage.
    – bob
    Commented Mar 15, 2019 at 21:25

Any recruiter should know that many excellent software developers have only done work that is the property of their current or previous employers, and that work is also often mixed up with the work of many other people. If he doesn't know that, or ignores it when you tell him, look for a different recruiter.


I had the similar issue with local recruiter. He literally have asked to develop the entire project as a DEMO, and to check it out that it does work - you host it on your own and just show them link. After that, he said it was great, and have asked to send him FULL source in .zip format. And we have never met before, nor I was given any details about work position, not to mention expected salary level etc. So all communication has been done via phone and email. I just refused to send the project, with argument that I would love to show them but ONLY after they invite me to discuss in person at their company premises. He/they never replied again. And I was happy since I managed to see their SCUM. Asking a full project to be done with source code is really bad as hell, and prone to misuse.


I would never give a recruiter any code. I don't even do a technical screenings with recruiters. THEY aren't the ones that are going to be hiring you. Most of them just know "buzzwords" and wouldn't know good programming from bad. It's a complete waste of time and there are PLENTY or recruiters out there who are not going to make you jump through silly hoops.

Your most valuable resource is your time. If you waste it proving to a recruiter that your capable, then have to turn around and spend more time proving the same thing to the actual company doing the hiring, all the time spent pleasing the recruiter is a waste. Now imagine you don't get the job offer. That is a lot of time you've invested.

Plus you should NEVER give code that is the property of someone else. Maybe this guy/girl has connections with your current company's competitor and is phishing for code.

I think you've done MORE than enough. If they aren't satisfied, find a different recruiter.


It's not necessarily a scam or a fraud for a recruiter to ask for code samples. They want something to evaluate you by. It could be something they ask in total innocence. But it's nevertheless illegal for you to give them code you wrote for another employer. If they don't see that, I'd say, "Suppose I was applying for a job as an auto worker. Would you ask me to give you a car that I had built for General Motors so you could evaluate the quality of my work? Don't you think GM would object to that?"

Writing some sample code just to give them something to look at seems like a reasonable solution to me. They asked for more? How much did you give them, and exactly what did they ask for? If you gave them one 10-line function and they said, "Well, that's nice, but we really need to see more than that", I think that's quite reasonable. If you gave them 20 pages and they want more, I'd ask what specifically they want to see. If they say, "We need to see an example of a class with subclasses" or "... of a complex SQL query" or some such, okay fine.

If they say they want to see code that meets some requirements specified by them, I'd start to get suspicious this was a scam. Like last time I was looking for a job, 5 years or so ago, I saw an ad from one company saying that they wanted applicants to develop a complete system with such-and-such screens and reports, thoroughly debugged and complete documentation, for them to evaluate. My thoughts were, (a) This sounds like a scam. They want a system meeting these requirements, and rather than paying for it, they want to get people to write it for them for free under the guise of a "job application". And (b) Even if an honest attempt to evaluate job applicants, developing a system of the size and complexity they described, yes, it was a small system, but still half a dozen screens and a dozen reports, would surely be a week or more of work, and writing quality documentation would be at least days more. There was no way I was going to devote 2 weeks of effort to applying for one job, not even for an interview, but just to sending in an application. How many other jobs could I find and apply to in 2 weeks of effort?

If someone demands that you break the law and/or violate routine ethical standards as part of applying for a job with them, I'd naturally wonder what they'd expect of me AFTER I had the job. Seriously, if I have to violate copyright law and confidentiality agreements to get the job, once I'm there will they be asking me to defraud stockholders, cheat customers, and file false income tax returns? If they just didn't think it through, I'd explain the problem. If they say, "Oh, good point, we didn't think of that. How about we do X instead?", I'd say okay, maybe they really just didn't see the problem. But if they knuckle down and say, "Do this or you don't get the job," I'd say "Nice talking to you, good-bye."


Don't tell the recruiter you can't give code from your current employer.

Just send your sample code (not your current employer code). If the recruiter asks say it's from the current employer.

Two things can happen.

1) The recruiter as usual does not know how to check your code. He or she will redirect your sample to client developers who don't care if your code is from your current employer or not.

2) This is a scam and they want your employer code. In this case they will complain that your code does not look like your employer's business.

In case of 2 you can go have some fun and ask them "Hey, how do you know?"


The conscious here is that you should not give a recruiter your employer's code, but there seems to be a lot of controversy in other answers about how to tell a recruiter 'no' which deserves more focus than I can put in comments. The best answer to this part of the question is to tell the recruiter that you know that what he is asking would be illegal and that you can not under any circumstances fulfil his request.

The reason you should do this instead of playing dumb or pretending code is from your current employer is that the question may itself be a test of YOUR ethics and not the other way around. The best way a recruiter can see if a candidate will honor their proprietary information is to see how well he protects the information he is already responsible for.

If you are talking to a scammer, they will either stop the interview right there not wasting any more of your time, or they will continue to pursue that line of questioning like a shady car salesman trying to make quota. They may even make threats like, "Well, I can't consider you for this position unless you do this". If they pursue the line of questioning, don't waste your time here no matter how desperate you are for work, there is no job there for you, just get up and leave.

If they are a legitimate interviewer, then they will move onto the next question.

The last possible factor for consideration is that they are collecting code samples on behalf of the client, but it does not actually need to be from your current employer. Here's the catch: it's much easier to compare code quality between candidates when they are all solving the same problem. This is why most experienced recruiters give you a problem to solve instead of asking for arbitrary code; so, if a recruiter asks for an arbitrary code sample, point out this fact and then have them tell you the problem to solve and this will avoid a situation where they may keep asking for more and more.

Also, such code samples should never be full projects. A typical sample request should not require more than ~100 lines of code to complete. Generally, they just need to see that your code is logical, easy to read, and that you can properly handle things like recursion, nesting, and error handling. Everything else they need to know about your programming style can be resolved by interview questions.


Asking for more code is shady. But not, as you described, so shady as to justify walking away at this point.

Since they are clearly interested to see what you can produce, perhaps it's time to seriously discuss hiring you so you can bring your considerable skills to bear on their projects.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .