I’ve been using a testing task that the candidates worked on at home and then during the “technical interview” we went through what they did.

My logic was that some people might not like the stress of solving a problem under time pressure and with someone looking over their shoulder.

But I like your approach a lot. Especially the first part. Quickly understanding other people’s code is important part of the job.