- Pick a real world task (e.g. text munging).
- Suggest in advance that they bring a laptop with their preferred work environment. Allow any reasonable language if you're willing to train them on your stack.
- Write the problem down ahead of time. Have someone else at your company read it.
- Do the problem yourself. Ballpark your estimate for a great candidate at 3x the time it took you.
- Tell them there is no penalty for using stack overflow over the language docs.
- After you give them the problem, give them a few minutes in peace (leave the room) while they think it over. Talk about their approach out loud before they begin working.
- Ask them to spend 5-10 minutes re-factoring their code once it's working.