When answering technical questions or writing code on the whiteboard, think out loud as much as you can. Getting the right answer is often less important than showing that you're smart and know how to think through problems. Think about it from the interviewers perspective - they're trying to figure out whether you're smart and someone they'd like to work with. When you're silent, it's hard for them to gather information.
Also, draw pictures! Before you write code on the whiteboard, discuss your approach, and draw any appropriate data structures/ui/etc. Once you've got buy-in from the interviewer that the approach you outlined sounds reasonable, then begin to implement it. This will not only score you points from the interviewer for taking a methodical approach, but will also make it more likely that the code you do write is well thought out.
Comments
When answering technical questions or writing code on the whiteboard, think out loud as much as you can. Getting the right answer is often less important than showing that you're smart and know how to think through problems. Think about it from the interviewers perspective - they're trying to figure out whether you're smart and someone they'd like to work with. When you're silent, it's hard for them to gather information.
Also, draw pictures! Before you write code on the whiteboard, discuss your approach, and draw any appropriate data structures/ui/etc. Once you've got buy-in from the interviewer that the approach you outlined sounds reasonable, then begin to implement it. This will not only score you points from the interviewer for taking a methodical approach, but will also make it more likely that the code you do write is well thought out.