I have seen people writing code which is hard to test and later writing tests just for the sake of it. Although having some tests is better than having no tests, you should always write tesable code.
TOP 6 Coding Interview Tools for Screening & Testing Web Developers
This article covers all major coding interview tools that will help you test developers’ knowledge and ensure a fair unbiased recruitment process based on merit.