He explained that, "for future reference" it was "expected" of programmers to keep real-world samples of their code from proprietary jobs, and that he had stuff he had worked on for a number of large companies. That certainly did not sit well with me, but I was looking for work, and even went so far as to ask my old boss if he could send me some of the stuff I had worked on. (In this case, a base class that would be pretty useless without the real guts in the derived classes.) Of course my old boss said no as expected.
I've only had three full-time jobs in my carreer thus far (one for three years, one for three months, and my current one.) But I've been on at least 25 interviews during that time. Several of them asked for code samples, but only that one asked to see proprietary code. After thinking about that experience for a while, I realized that he was probably just incompetent at best, a jerk at worst, except for what he mentioned about it being "expected" for programmers to keep stuff they've worked on. That still piques my curiosity. So,
- What do you provide when interviewers ask for code samples? Do you try to tailor your samples to the specific requirements of the job?
- Has an interviewer ever asked you for proprietary code? What was your response?
- Do you keep code you have worked on in the past, even if it is just for reference and you have no intention of showing it to anyone?
- If so, do you think this is a normal or common practice among programmers?
I didn't get that job, of course, and my current employer didn't ask for any code samples at all. (And it has turned out to be a great job.) So I'm interested in your experiences.