My approach has just been to have a conversation, and try to move it along naturally. What do you think of concepts? What useful STL did they add? Why did you go with this design? Ask me something.
If the person doesn't really have the level of interest required, they will run out of things to say. Like a cave left unexplored. The good candidates will go down all the caves with you, even if they don't quite know what's there.
In particular, the times I've had dud hires it was not possible to know from the standard fare of coding questions and IQ questions. When I was doing that obviously the people I hired passed. But for instance one guy really didn't want to be a programmer, he just knew how to answer the questions. He ended up stalling on his first assignment, and eventually decided to change careers. Another dud also lacked motivation, perhaps because he was asked to do something not quite in his area to begin with. He ended up not doing anything at all.
Apart from those two, dozens of others have turned out ok. I never ran into that guy who couldn't do FizzBuzz, despite not asking. I also don't think it was all that bad to let go of the duds within a quarter, they never got so ingrained in the team that we depended on them, and they could plausibly move on to another job without mentioning us on their CV.
I was a hiring manager for 25 years, and this was exactly what I did.
I made very, very few mistakes, and actually had some pleasant surprises.
How do you know? How often did you follow up on rejections to see whether they should have been hires?
The only one that made me sad, was a chap who used to show up on the Adobe Photoshop splash page. We offered, he declined.
In the aggregate, I think things turned out OK for all of us. There are some folks that I have to admit, probably did best by not accepting us.
Yeah, I hear that. I remember interviewing someone who was _good_, but not at this narrow thing that we were hiring for. She seemed SO hopeful that we would give her an offer, I wanted to tell her directly "this job is going to waste 6 mo of your life and offer you nothing I return"
He turned out to be an amazing hire. I think that he far outstripped the first choice, and he has gone on to do quite well, after leaving our company.
I like to think that I ran a fairly good shop. We kept people for decades.
When they finally rolled up our shop (after 27 years), the person with the least seniority had ten years.
Look for curiosity, interests and blend them with your product.
I just have a conversation and ask them to tell me about a favorite code project they've worked on. Could be school project, previous job, whatever.
And just let them talk about it. I'll prod for more detail if I need to give a little nudge. Ask about problems they solved when doing it, etc.
The _only_ thing that I'm looking for in this process is whether or not the person is truly interested what they're doing. This comes through when talking about something they're excited to have worked on, seemingly small problems that they had to really work to solve, etc. Geeking out, if you will.
The single most important trait I've seen in programmers that I've worked with over the years is "level of interest". There's too much that you have to learn on a daily basis to be successful in this field. If you're not interested in learning new things and finding solutions to the problems that you encounter, you're not going to make it very far.
Beyond that and basic competence in the core skills that the job requires, I don't look for much more.
Thus far, everybody I've ever hired who has passed this little conversational test has been an excellent team member.