Just do several interviews in a row to learn what the common questions are. Then memorize those 3 or 4 solutions.
There's been a move this year to fully using the 1 hour coderpad period with a large problem, so you really need to go in with a prepared solution. (Thanks a lot, a(7) interviewers.)
As one of my friends said, "Interviews are a lottery." So do your best, then move on to the next one (see above.) Don't take it personally, just keep improving.
Also, if an interviewer says, "it doesn't matter if it runs or not" or "syntax doesn't matter", assume they're lying and fix it. (Again, thanks a lot, a(7) interviewers.)