It really is terrible. Companies need to accept this.
You're sitting behind me. Or beside me. I can smell your breath. Or you're on a webcam. It's voyeuristic. You've already solved this problem. Perhaps you even designed it. Your talking is breaking my concentration. This is not how I work. It's probably not how you work either, and if it is, I think we're done here.
Now, if a company insists on an adversarial process, there are better ways to do it. The nature of the problem is given in advance. Both the subject and the evaluator go in blind, and they both do it.
You know what I call it when a coworker is reading off a document and harassing me for not knowing the thing they're clearly looking up as they go along?
A toxic work environment.
Of course, I believe a significant number of those "interviews" are hazing meant to find excuses not to hire or perpetuate H1B scams.
I was in our spare room coding one day. My girlfriend arrived home and sat on the sofa behind me. I couldn't concentrate just knowing she was behind me and asked her if she could leave.
Now, if a company insists on an adversarial process, there are better ways to do it. The nature of the problem is given in advance. Both the subject and the evaluator go in blind, and they both do it.