If you're asked to 'code a solution to this problem on the whiteboard', the honest answer would probably be that you normally use google for reference, old code etc. and the ingenuity would be for you to write some psuedo-code on the board, anyway.
I think this applies to lots of questions.. "Can you tell me how you would sort this data set?". "(honesty) I don't know how, off the top of my head but (ingenuity) I know I could utilise an algorithm and I would probably google/research which would be most appropriate".
I'll finish with an anecdote.. in my first IT interview (server builder) I was asked to tell the interviewer what RAID stood for, and which type I would use to ensure my data was safe if one drive blew up. In my inexperienced state of mind, I murmured and was clearly distressed. The interview interrupted and said "If you don't know the answer.. just tell me you don't know, and that you'll find out and tell me later".
The lesson there is, sometimes there isn't one clear answer to an interviewers question.
Good luck :)