I've been asked to do a codility test (online 3 problem coding test) before one interview and a short basic form processing code for another interview. Both took about an hour. That seemed fair to me, though if it were longer I probably wouldn't feel that way. It also was clearly not "real" work they could use for production.