The point of whiteboard interviews are supposedly to understand a person's thought process when they're solving a problem. They're supposed to explain step by step so the interviewer can pick their brain a little.
If an interviewer scolds you for writing whiteboard code that will cause a compiler syntax error, red flag, time to bail out. This is now how they are supposed to be done.
Properly done I might go against the grain saying I prefer whiteboarding tests over take-home tests. With whiteboarding, both parties are at least with equal time investment and a higher level of transparency. And once the interview is done, it is done. No thinking about how to schedule your next few days around finishing unpaid work for a company that you may have a chance with.