It's not unreasonable to ask someone to demonstrate their capabilities. Just make it interesting, relevant to the job and most importantly: short. Whatever time work sample testing requires should replace interview time, not add on to it. 2 hours is a reasonable ask. Oh, and you can't ask people to invest time in a work sample test unless you've already invested a significant amount of YOUR time on in-person interviews. [2]
screening interview -> coding assignment -> maybe more interviews? = not cool
screening interview -> first round with hiring manager -> coding assignment -> review assignment with candidate -> maybe more interviews? = cool
Sources:
[1] https://www.researchgate.net/publication/232564809_The_Valid...
[2] Me. I'm a ex-Netflix software engineer, now run a tech recruiting company (www.facet.net). I've seen hundreds of technical interview processes across many industries.