To add some opposite perspective to this, jobs interviews are extremely stressful, and it's really, really, really hard not to psychologically trigger people. Even if you tell people ahead of time that you're going to ask a lot of questions about a variety of topics to get a well-rounded picture of their skills, including a lot of things that aren't strict requirements for the position, even if you tell them it's a conversation more than a test, even if you tell them that virtually all successful candidates have gaps in their knowledge that will come up in the interview, even if you explain all that and do your best to come off as easy-going and approachable, still.
Still.
A lot of people will panic and freak out the instant they hear something they're not prepared for.
In an ideal world you would only ask questions that no qualified candidate could possibly have difficulty with, even under severe stress, but there's no way to do that.
An additional complication is that interviewers can't just walk away knowing whether the candidate can do the job. They need to give a more complete evaluation of the candidate so the hiring manager knows what to do if the candidate negotiates for a higher salary or asks the company to match another offer they've had. This often depends on "nice to haves" such as advanced SQL skills or the ability to quickly assess the big-O complexity of an algorithm and figure out how to improve it.
Still.
A lot of people will panic and freak out the instant they hear something they're not prepared for.
In an ideal world you would only ask questions that no qualified candidate could possibly have difficulty with, even under severe stress, but there's no way to do that.
An additional complication is that interviewers can't just walk away knowing whether the candidate can do the job. They need to give a more complete evaluation of the candidate so the hiring manager knows what to do if the candidate negotiates for a higher salary or asks the company to match another offer they've had. This often depends on "nice to haves" such as advanced SQL skills or the ability to quickly assess the big-O complexity of an algorithm and figure out how to improve it.