Tech bros love to ask a job candidate to demonstrate skills under pressure of a job interview.
This approach makes sense. Of course you want to try their skills.
So long as it is only one piece.of the puzzle. There are other considerations.
You are not testing how well they code in a safe environment. The best test is past results, though it is hard to tease out individual contributors.
EQ really does matter. Programmers don’t live in back rooms any more. But that is also hard to assess under pressure.
Team fit matters too. But there is no way to test that except try.
Bottom line: the only good interview technique is a 90 day trial. New Zealand enshrined it in law.