As a developer and a manger, there are many candidates who fake or bolster a resume, especially in tech. Additionally, there are some developers who are incredibly smart, but take 2-3x the time as someone who is not as senior to do the same task.
The only way I've found to reliably hire is a coding test. I think it's ethically irresponsible to choose actual client work for the task. But it is important to create a test that is similar and with a time constraint, especially if you work on any projects with deadlines so you can simulate how they work under a time crunch.
Not just ethically irresponsible, it is probably illegal. Unpaid work that a company has someone do must be of no value to the company.
It would be legal (though the ethics are still questionable) to give someone work after the client has decided not to give you a contract, as then there is no value in doing that work.
This is why most big companies prefer to to hire contractors. You get someone for 6 months, if you like them you hire them, if you don't you let the contract expire.
What about paying someone to do client work as a test? That is what I've found to be the best approach for me. It gives the candidate a very concrete understanding of the kind of work they'll be doing as opposed to a more contrived example. It comes at the cost of paying for poor work but usually some portion of it is salvageable.
The only way I've found to reliably hire is a coding test. I think it's ethically irresponsible to choose actual client work for the task. But it is important to create a test that is similar and with a time constraint, especially if you work on any projects with deadlines so you can simulate how they work under a time crunch.