As a programmer, I'm often given sample projects or other homework when interviewing for jobs. Most of these projects are solutions to puzzles or other small coding assignments, but sometimes I spend a fair amount of time putting together a larger project (for example, a demo of a game, or a demo implementation of a particular third-party framework). Because I put real work into these projects, I want to be able to use them in my portfolio, as examples of source code I could share freely. I have a few questions regarding this:
First, can I get in any legal trouble with a company for doing this? I presume the answer is no, as I've never signed any sort of non-disclosure agreement for the companies I've been interviewing with.
Second, is this a bad idea for ethical/professional reasons? I could imagine future employers being wary about interviewing someone who has put previous interview questions (and answers) online.
Third, which I suppose is the heart of the issue here, do companies have a reasonable expectation that interview questions/technical challenges they use are private information?