I have to be a bit cautious here, because our company does something similar.
We have a little programming challenge that we ask candidates to submit. We don't use those submissions in production. We find it gives people with non-traditional backgrounds a chance to show their chops, and gives us some meat to discuss during an interview.
The challenge probably takes 4-8 hours, though. Part of me does think it's a little asymmetric for us as employers to be demanding this of candidates. We've also done week-long work tests, where we pay the person market rate to work with us on real-life code.
Anecdotally, people view the paid week-long trial as demeaning, but the (unpaid) challenge as exciting and fun. We live in a bizarre world.