We deal with the issues brought up by others that most developers can't really do this, by asking them to bring a piece of public code that they like and give 10 minute presentation about it.
The code that they select tells a lot and is a great starter for further discussion and finding out about how they think.
It also demonstrates an essential skill, and that is evaluating other peoples work and how to work with it rather than against it.
Many would reply with open source or personal projects, but I will head that off by saying that not everyone does open source (for some people, 50 hours programming a week is all they want to spend) and there are many who do open source in other areas and perhaps not with the same level of professionalism and expertise.
Someone who can show their own past work, either open-source, side-project, launched projects, or work at somebody else's company ... well there is a high chance that they can at least code their way out of a wet paper bag. Probably more than that too.
Another, perhaps better, approach is to just hire a few of the most promising candidates for a couple of days. Give them a small project. See if there's a fit.
Ugh, this is acceptable, I guess, provided the company is willing to pay an hourly wage. I'm currently in the process of looking for a new gig, and there's nothing worse than being sent a coding challenge that should take about '2 hours' (4-5, more like), and then to get a canned rejection from the recruiter stating the code didn't pass muster. This is especially annoying with companies with DEEP pockets - at least do me the courtesy of paying an hourly wage OR have an engineer on the team go over the code and give some feedback.
You'd pay them. You'd take something small that needs doing, outlay a much larger than usual slice of money to it and hand it out to all of the last line of candidates.
how do you demonstrate this?