I interviewed with one company whose approach to this was smarter than most: they gave me a little problem to solve, but paid me a couple hundred bucks as compensation for the time I'd need to put into it. That took the sting out of having to do a homework assignment on my own time.
I suppose the main objection to that would be "but we'd end up paying out so much money to people we don't hire!", but that feels to me like it says more about that company's recruiting process. Just wait until you're serious about potentially hiring somebody before you bust out the homework assignments and you're fine.