I don't expect interviewees to "ace" whiteboard coding exercises, because the point of my questions isn't to answer the question: it's to see how you solve problems. Do you ask smart questions before writing anything? Do you put something down and then refine it? Do you handle errors? Do you understand the performance, maintenance, and testability implications of what you've written? That's what I'm looking for you to answer.
Then again, I work at Pandora, so this is probably an outdated approach...