If the job has a large coding component, the candidate must code at some point in the hiring process. Take-home problems work out worse than interviews, primarily because coding isn't a solitary practice.
Discussing a problem, getting a shared understanding and outline of the solution, and then seeing how the candidate turns that solution into code - that's the kernel of a coding-heavy job, and it needs to be observed during the interview process to make even an approximate evaluation of their ability.
Other forms of observation can substitute: strong personal recommendations from previous co-workers, or famous accomplishments visible from afar, where there's no doubt as to who exactly accomplished them. But observation must be made.
The job I'm recruiting for requires someone to be able to write code. Also, there are a lot of bullshitters in the world. Given these facts, I conclude that writing code in a an interview for a position where you'll be writing code is necessary.
The point is that coding during an interview, whether digitally or physically, is a stupid practice that solves nothing and needs to stop.