I applied for a job in a small company (~25 employees) on December and after a month the CEO of the company wrote to me that he is interested to interview me. During the interview I got a bad impression of the employer and decided that I would not want to work for the company. However, the interviewer asked me whether I want to do a mini-project for them involving a complex but very interesting scientific problem. I told them I didn't mind, because I am interested anyway in this kind of work. It took me 3days to a week to finish it. My technique would easily become much faster with a few more modifications, but I was not ready to invest more time and end up having my code stolen or used and getting the job denied. I am going to write a short description of the technicalities from which someone who is smart enough can see the extension to the technique I used to make it much faster. I was thinking of licensing my code under MIT License and the documentations under something like creative commons. This will theoretically/psychologically gaurantee me that they won't steal the code (though they can steal it if they want and I wouldn't know). I am explaining in my documentation how the code could thereotically be improved in specific places and this will give them a gist of my abilities. My question to the forum is: Am I being rude or illegal by trying to license the code and my text? The problem was given to me as a pdf file and on the file it was written for internal use only, I didn't sign any contract or made any promises. I feel this is the best way I can protect myself and I still want to solve the problem because of my interest in it and because this is the kind of work I want. Worst case is that I don't get the job but after this work I can almost publish a paper on this problem and at least improve my scientific profile. Edit : Just to let you guys know. I decided to license my work and send it to them. For future applicants who have my situations, I will give an update of what happened. 
Licensing code submitted after job interview
licensing;interview;source code;mit license
There's a couple of different aspects here that need to be evaluated.In the absence of a contract between you and the potential employer, you continue to own the copyright for any code you write in consideration of being hired.  Likewise, unless you explicitly state a license on the code when you provide it to the potential employer, then you have not licensed the code to them.Since you own the copyright to the code, you can do whatever you want with it later on.  That also includes releasing the code under whatever license you like such as the MIT, BSD, Creative Commons, or GPL licenses.As you haven't licensed the code to the potential employer, they should not use your code in any of their applications.  Why not?  Because you haven't given them permission to do so (yet).  Note that if you later release the code under a permissive license (such as MIT or BSD) then they would have license to use your code.  You could put a poison-pill on your code by licensing it with the GPL which could potentially force their application to be re-licensed as GPL if they used your code and weren't careful in how they incorporated it.Unfortunately, copyright law and employment law varies (sometimes considerably so) by jurisdiction, and if you're really worried about this aspect then you'll need to consult an attorney specializing in intellectual property.You also asked:Am I being rude or illegal by trying to license the code and my text?No, actually it's quite the contrary.  By licensing the submitted code, you're provided explicit permission to use (or not) the code that you provided.  The potential employer has made two significant mistakes here.The first mistake involves disclosure.  They didn't have you sign any documentation or non-disclosure agreements prior to providing the assignment to you.  If that assignment is part of their mainline work, then the risk of exposure is on them, not you.  Just because you interviewed with them, you are not bound by any legal requirements regarding non-disclosure even though you may feel ethically bound to not disclose.  The second mistake involves licensing.  Giving you an assignment related to their mainline of work without documentation or a contract makes things very problematic for them.  As you haven't provided the code under a license to them, they are not allowed to use your code.  Lack of a contract leaves things in a questionable state, which puts a legal burden (aka headache) on them if they want to use your code.  The worst case is they have to come back to you and say Hey, we don't want to hire you but we still want to use your code.  Will you license it to us?The above is one of the reasons why most companies do not have interview candidates develop code against problems the company is actually experiencing with their applications.  It's far easier to come up with a smaller design project unrelated to their applications in order to evaluate your code writing ability.  It creates intentionally throw-away code that has no legal bearing upon the company's mainline activities.