This is a common misconception. Unfortunately, most (read 99%) interviewers expect you to come up with exactly the same solution they have in mind (or in paper/screen in front of them). Even if your solution is correct but different, as soon as you start to diverge from their solution, you're red-flagged.
I interviewed a bunch, but not for a few years. More recently, I've been on the other side of things. In all my experience: yes, some people expect a very specific answer from you, but not most.
Most people look at how you approach the problem, how you solve it, and what questions you ask about it if you need any clarifications. You can often tell someone is a good programmer even if they don't fully solve a problem, or if they happen to pick an approach that doesn't work out.
Again, that's my personal experience and knowledge, so I can't be sure how common it is.
PS: I interviewed at mid-sized startup companies, all 100-300 people.
If you go through a 3 person loop and get 2 problems right and 1 wrong, you might get an offer, but I guarantee that the voting would be two "hire" votes from the questions you aced, and a "no-hire" vote from the one you failed.
There are a couple of reasons for this. The most obvious is that, given two candidates, the better choice will (at least appear) to be the candidate who got the most questions right.
The more common scenario that I have seen is that engineers simply work backwards. If you got the solution wrong (or didn't finish) their thinking will go something like: they got it wrong -> they went down the wrong path since they chose a hashmap instead of a tree -> they are weak in data structures -> no hire
I am at one of the bigger tech companies, and it really is a roll of the dice on if you get a question on a topic you have studied. Especially if you have been out of school for awhile.
The worst part is that bigger tech companies force hiring on the engineers. Hiring candidates becomes part of your own career advancement. If it is a big company, you will go to a day of training and suddenly be a professional interviewer. It is even worse since my opinion (that this system is awful) seems to be the minority. All of my colleagues think they are great at hiring, pontificate over lunch on what makes a good candidate, and discuss their favorite questions (well, their favorite questions from the standard set of questions from the company bank. This is science here, obviously we use standardized questions.)
Of course, if you fail in the interview, you can always come back. It's not like I've ever heard a colleague say, "sigh I am not looking forward to this interview; We've already turned them down once."
Have you interviewed much recently, or are you going on what you hear about bad things in the interview process? (The bad stuff tends to get more mentions.)
It might not be as bad as you think. Yes, some amount of whiteboard work is common. But it shouldn't be about "topics you may or may not know" - that sounds bizarre to me. You should be tested on a language you know, and on a problem that a reasonable person would be able to solve. Also, the focus is often on how you approach the problem, not if you write up a perfect solution or not.
Overall, what you describe sounds like a horror story ("one interviewer wants us to code a particular dynamic programming question the way they are picturing in their head"). I don't think that's as common as you appear to think.
It sounds like you are reluctant to even start interviewing. Why not try, and see how it goes?