After an initial phone screen, we give candidates a short programming exercise that they can complete on their own time. We feel that engineers work best when they have time to think about a problem and work on it at their own pace with their own tools.
If the solution passes some objective criteria that we have, it then forms a significant component of the on site interview where we discuss their solution in depth and have them talk about the decisions they made and opportunities for improvement. Not only does this allow us to ensure that they actually wrote the submitted solution but it gives the candidate the chance to speak from a position of authority on their own code.