I think assignments are a really good way to test people, but they really do have to be short. The second-last job I got took around 4 hours which I think is fine. Helps if the task is a bit fun too.
Also it shouldn't be the first stage of the interview process. That's just taking a piss. For this job it was after a phone interview, and with a scheduled face-to-face interview (where we discussed the code I'd written).
Getting a (new) job in IT is an exercise in futility if you don't know someone inside, so essentially there's not an interview but an invitation.
It's lower-status, more degrading and has worser odds than cold-call telemarketers trying to sell you some new credit card.
By the way, when a telemarketer tricks you into answering his call, you don't subject him to a 3-days intensive rectal exam ("homework") just for the remote possibility of getting a new credit card, which at the end you still don't buy anyways on some made-up pretense.
So developers agree to way worse level of abuse and degradation than the lowliest sales guy.
Also there's one and only one defense with respect to abuse either at interviews or after you get the job: having a large stash of money, which allow you to say NO to abuse.
At least 5 years runway, entirely on your own "payroll". If you're actually competent, that's more than enough time to pick any skill (possibly starting your own business rather than look for a job using it), if you can do 12 hours per day by your own choosing on whatever you see fit.
Don't have those 5 years but only 1-2 or, god forbid, have nothing more than a few months on top of a large amount of credit you have to pay back.... and you're in the 99% percent of desperate and destitute crowd who will submit to anything in exchange for a bowl of soup (guarantee they never break out of slavery).
Problem with the solution is that it's a vicious circle: if you don't already have those 5 years of savings, chances are you're never going to save them anyways.
Also it shouldn't be the first stage of the interview process. That's just taking a piss. For this job it was after a phone interview, and with a scheduled face-to-face interview (where we discussed the code I'd written).