It doesn’t work for software engineers because nobody wants to do free work. Also, free work isn’t consistently, and fairly testable because project requirements can evolve or completely change over a hiring period. Not to mention IP issues.
What has worked in my experience is a synthetic take home exercise that isn’t easily LLM solvable, the same one given to all candidates with the same constraints, and offering to be available to answer their questions by email. Sometimes we can tell a lot about the candidate just from the questions they ask, or how they package the solution, without even looking at the code.
In my experience (FANG hiring) less than 10% of candidates refuse to do this exercise, so it’s worked well for us.