we do this at my current company.
I think it is a great alternative to whiteboard tests as long as it is reasonably short.
For mobile devs, we ask them to write a simple app solving a problem they should be familiar with and that we have had to deal with in the past.