It’s very hard to guarantee that every first-round interview includes a seasoned lie-detector. A coding exercise is an imperfect, flawed, sometimes insulting approach that’s better than the alternatives.
When done right, it can be a nice conversation about coding, algorithms, and how to collaborate. And prove that the candidate can code.
Personally, I don’t mind being interviewed with a coding exercise even though I could be many of my interviewers’ parent. I love programming and talking about programming with programmers! And it gives me a chance to interview my potential future collaborators in a setting that’s less structured than a sit-across-the-table Q&A.
In my experience, someone who refuses or takes offense at a well-framed coding exercise is probably not going to be someone you want on your team. By well-framed, I mean introduced in a way that’s not insulting on the face of it, like a multi-hour takehome exercise before even meeting the candidate and talking about the job and why you are interested in them as a candidate. That’s just lazy interviewing and I wouldn’t want to do that either.