Programmers are asked to program in a job interview - what a ridiculous idea. Perhaps when I hire programmers I should ask them to paint or dance?
And then there's the racial/gender/age bias nonsense on top of it. We've been asking programmers to write code in all job interviews, and: about half the team is women (including 2 of the 3 team leads), and about 20% are white (rest are Russians, Indians, Asian, Israelis). Why would asking to code be a bias against anyone except people who can't code?
Interviews are never an exact process, and I agree that riddles ("a chicken and a half lays a egg and a half in an interview and a half") and knowledge questions ("what is NP complete") are a waste of time. But if you can't code a sorting algorithm without a reference, or if you can't come up with a simple client server algorithm, or if you can't devise a locking scheme to have multiple threads cooperate on a resource, then you don't have the skills I need. I might be missing people who'd be great on the job if I just gave them a chance, but I can't just hire someone and fire them 2 weeks later if it turned out they can't do the job. A free trial would be ideal, yes, but it's not realistic in our job environment. BTW, I always ask interviewees to write code at home and email it to me - this can count as another way for people who struggle in front of a whiteboard to get a second chance. But I've never seen someone who was great in the email and awful in front of the white board.