I’m curious to know what you think a better way would be?
I'll be crude but whiteboard interviews are fucking stupid, obnoxious and wastes time, you will definitely miss out on quality candidates. You might as throw a personality test in for the ultimate combo of "how to fail at hiring"
This is a topic that has been discussed to death for years and there are ample resources on the Internet for anyone who is genuinely interested in alternative approaches to whiteboard interviewing.
I have a simplified skeleton of class that is similar to the problems we solve every day and failing unit tests.
They have to make the unit tests pass.
Then I give them a second set of requirements and they have to make the second set of tests pass without breaking the first set.