I’ve just asked that to ChatGPT and this is the exact answer it gave :) Ironic, isn’t it?
Would you ask a prospective employee to send you code they wrote in their previous company?
Short answer: *no, I wouldn’t—and it’s generally a bad idea to ask.*
Here’s why, and what to do instead.
---
## Why you shouldn’t ask for code from a previous employer
1. *Legal and contractual issues*
Most employment contracts assign ownership of code to the company. Asking for it puts the candidate at risk of violating:
* IP assignment clauses
* NDAs
* Trade secret laws
2. *Ethical red flag*
A candidate who
does share proprietary code is signaling that they might do the same to
your company later.
3. *Biased signal*
Some candidates (especially senior or well-trained ones) will refuse on principle. You’d be selecting for the wrong behavior.
4. *Low signal-to-noise ratio*
Real-world code is often:
* Highly contextual
* Entangled with proprietary systems
* Hard to evaluate without full context
---
## What to ask for instead (better options)
### 1. *Open-source contributions*
Ask for:
* GitHub / GitLab profiles
* Public PRs or issues
* Personal projects
This shows real-world collaboration without IP risk.
### 2. *A take-home or live exercise*
Design something that:
* Can be completed in a few hours
* Mirrors the work they’ll actually do
* Is clearly stated as theirs to own
Bonus: allow them to explain tradeoffs rather than just write code.
### 3. *Code walkthrough (descriptive, not shared)*
Ask them to:
* Describe a complex system they built
* Explain architecture, tradeoffs, and failures
* Talk through how they’d improve it today
This is often more revealing than code.
### 4. *Pair programming / problem discussion*
Observe:
* How they reason
* How they ask questions
* How they handle ambiguity
---
## When it might be acceptable
Only if *all* of the following are true:
* The code is explicitly non-proprietary
* The candidate confirms they own the rights
* It’s already public (e.g., open source)
Even then, I’d still be cautious.
---
## Bottom line
> *If a candidate shares proprietary code, that’s not a plus—it’s a liability.*
Strong hiring processes test:
* Judgment
* Reasoning
* Communication
* Craft
—not their willingness to break an NDA.
If you want, tell me:
* The role (junior/senior, IC/lead)
* The domain (backend, ML, frontend, systems)
…and I can help you design a fair, high-signal interview process.