I suck at whiteboard interviews. I've been in quite a few interviews in the last few years, and for every time there wasn't a whiteboard session, I got a job offer.
When I was an interviewer, I didn't see a lot of value in a blank whiteboard and a bunch of computer science questions. I wasn't looking for the vaguely useful smart people; I was looking for specialists - people who had done the work I need done before. Thus I would ask how the candidate would solve a given problem, and we'd have a discussion about the answer. This discussion allowed us to cover quite a bit more ground in the same timeframe.
As a candidate, I did discover a few strategies for surviving a whiteboard interview:
Talk through your thought process as you're working. Sometimes it's more about process and communication than about the solution.
Use your interviewer as a substitute for Google or Stack Overflow. You know that's exactly what you do when you don't know the answer anyway, and it's exactly what the interviewer does too. Demonstrate that you can find out what you don't know, and engage the interviewer at the same time.
Find out how the problem you've been given represents what the job will actually entail. This will give you an idea of how much you're actually expected to do on the whiteboard.
Don't worry about syntax errors; there's no such thing as a whiteboard compiler.
Start with some pseudo-code, and see if the interviewer wants you to expand it out into something more formal. You'll get a lot more done in the available time.
Can you tell what will actually happen in these snippets?
That's Odd: Tricks with bit shifts and bit masks. Avoid negative numbers in modulus (%) operations.
The One: Loops don't have their own scope. A variable declared in a loop is hoisted to the top of it's scope, and thus not reset during the loop. There's a reason that the convention is to declare variables at the top of functions.
Lootpy-loop: Be aware of the limitations of very large numbers. Computers are still 0s and 1s all the way down.
Why Are We Bankrupt: Be wary of ye olde floating point rounding errors. Always use integers - cents, not dollars.
The Prestige: No block scope or hoisting. Mind your operator order of evaluation. Use encapsulating parenthesis; be explicit.