I think is kind of stupid... why? Because first of all if you're trying to hire a developer that has already a job, the chances are that he won't make it to the job interview specially if he knows it will take not just one hour but more and a lot of companies don't interview after office hours.
Second thing is that when you have little time to develop something on a computer that's not yours and does not have the IDE you use nor plugins and stuff you're confortable with so you'll write very messy code specially and that's just crazy, how in the world are you supposed to do the front-end of a site and make it responsive in just 20 or 1 hour, I'm a front-end developer and that's the kind of job assignments I got to do.
It's way better that they give you the problem to solve or the thing to develop, but can be something way to complex for it to take it more than one or two days to work on your free time. And in the interview to see the code and make questions on what this function, css does or how and why you solve something. This is way better or just to do some little exercises like I need to to this thing or functionality or something that will not take you more than 10 minutos to solve.