> when you can just do the work

Careful there- I believe a number of jurisdictions will consider using someone's work before you've hired them to be very illegal.

You could take this to the logical extreme and just not hire anyone, instead building your entire product off of the work done in interviews. Many would consider this to be a form of wage theft.

It doesn’t have to be unpaid labor. I just mean if you’re going to ask someone to refactor legacy code, you could assess that. You don’t have ask someone to reverse a linked list if your code base doesn’t event have them. Ask them to solve a hard problem related to legacy software, or even just talk about it.