If it's any comfort: everyone performs worse under the stress of an interview. This is widely recognized by hiring employers, and accounted for in the interview evaluation.
For example, if I test-run a new question, and it takes my engineers 20 minutes to solve it, I will add 30-50% handicap for stress. I.E. if a candidate manages to solve it within 30 minutes, that's roughly equivalent.
Unfortunately, there's no way to account for someone having a complete blackout such as you describe.
Don't ask people to do something they've maybe never done before and will never have to do on the job (write code with a marker on a whiteboard as seconds tick down). If you want a reasonable coding assessment, sit them down at a terminal and give them an hour (and an appropriately difficult problem). But literal whiteboard tests are a recipe for complete blackouts.
> If you want a reasonable coding assessment, sit them down at a terminal and give them an hour (and an appropriately difficult problem).
I am doing just that.
> But literal whiteboard tests are a recipe for complete blackouts.
Not always. I've done a lot of whiteboard interviews too. It's a different way to discuss a problem, and one that people do use at work.
Most design sessions happen with a colleague or two in front of a whiteboard, not sitting at a workstation.
I disagree that blacking out is so common, though I understand it does happen occasionally. Also, we typically do at least 5 interviews in every onsite, one blackout wouldn't destroy the chances of an otherwise strong candidate.
It affects some people much more than others, it's not a uniform random occurrence, so a person with one blackout is more likely than most to have more than one. Some people are very anxious during interviews, and their frontal lobe basically shuts down, others love interviews. So it's very likely that many of the people you've interviewed who you thought "couldn't code" actually just couldn't code while you were watching them.
For example, if I test-run a new question, and it takes my engineers 20 minutes to solve it, I will add 30-50% handicap for stress. I.E. if a candidate manages to solve it within 30 minutes, that's roughly equivalent.
Unfortunately, there's no way to account for someone having a complete blackout such as you describe.