I use a collaborative code editor so I can see what the person is typing, and I don't give trick problems. I pose the question, and ask them to think about it before coding. Once they've landed on an acceptable solution, I ask them to write it up. 80% of the time it's broken or they can't finish it (these solutions should be 20 lines or fewer). On at least one occasion the answer was copied directly from stack overflow :\.
Trick questions are all the rage, but I'm not convinced that they actually highlight a competent developer. The problem (in tech, not specifically at Amazon) is we're all trying to emulate Google, and since they ask brain teasers then we have to ask them too, because it must be the one true way.
In summary, I think there is both a shortage of good devs, and contrived puzzle questions are not actually an good for evaluating a candidate.
(1) These views expressed are my own, and not necessarily the views of Amazon or its employees. Disclaimer added at my own discretion, not due to any corporate policy.