Hacker News new | ask | show | jobs
by divtxt 5274 days ago
Unit testing is another simple topic that provides insights into how a person thinks about code.

Exercise: give them a class with empty functions, and some unit tests. Ask them to write the class and add some more tests. Also, one of the tests you provide must be subtly buggy.

1 comments

fwiw we make people who are interviewing do unit tests on our production code. We have enough old gnarly code that we can always find something that doesn't have coverage. It is a great way to see how they code, how they interact with unfamiliar code and how they get on socially with the person doing the interview.
and a great way to improve test coverage for free!