Depends on the job. I typically give candidates a problem a few days before to see how they work without much pressure, but part of my job is to go into the field to conduct integration testing. I will often need to find, analyse and fix a problem under a ticking clock while customers and partners look over my shoulder. If you can't code in an interview you probably can't handle that part of the job.
As an aside I once had a candidate offer to show me some code he had written previously and proceeded to bring up the code he had written while working for several previous employers. Not exactly the way to give me confidence that our code would remain in the company.