At interviews where I've later been given an offer, it's usually a relatively small algorithmic design challenge, where the specifics don't matter, just the pseudocode.
In interviews I've given involving whiteboard programming, I've always emphasized that it doesn't have to be valid or even semi-valid code for any language, just a semi-rigorous pseudocode expression of an idea.
I think, "if done correctly", whiteboard coding is a good filter for those who can think algorithmically, who can catch the bugs that aren't typos, but incorrect assumptions.
That said, that sort of mindset may not be what you need for your role. Need to consider that.
---
Tangentially, one of the better technical interview experiences I've had involved chatting for a while, the interviewer describing an actual problem they'd had (relevant to the role and the company's product), and discussing my approach to the problem. (and passing or failing the interview wasn't dependent on using the exact same approach...)