The last interview I did was for a node.js position. I was told to bring my laptop. When I got there, the put me in an office and handed me a packet with instructions on checking out a nearly empty git repo. Then they said "Write an API that meets as many of the following requirements as possible and push the code. We'll be back in 3 hours." After 3 hours, I was taken to a conference room where I demonstrated the API…
That actually sounds like a decent way to do things. The only thing I'd change is making it shorter and trying to incorporate some pair programming at least to some minor degree to see how well they communicate along with developing.
In a company that does pair programming, sure, do that, because those of us that hate pair programming would then instantly tell them we're not interested and leave rather than waste time on an interview somewhere we won't want to work.
But likewise, if you're not actually doing pair programming day to day, don't do it in an interview setting.