To anyone who is involved with the hiring process for a technical position: dear god, don't ask the candidate to solve a problem on the spot. You're shooting yourself in the foot and missing out on the best people.
Simulate the actual skills you need in the role. You want people who can think carefully and solve real problems, not a chatbot that can write code as fast as possible.