I.e., pick a real project that will take 10-40 hours. Pay them to do it as a contracting/interview project. That even works for someone who already has a job, because they can do it in the evening/weekends.
Asking me to do a 5 hour homework project is an insult, but a paid short-term contract is fair. (However, some people have employment contracts that forbid side work.)
However, even that is abusable, because the person might find a more-qualified friend to help them on the trial project, who wouldn't be helping out for real projects.
I read another interesting post by someone else (I think it was the Monsanto guy), who said "Don't filter people out at the phone interview stage, unless they really fail the phone interview." His reasoning is that you're selecting for people who sound good over the phone.