Its not usually that difficult to work out if people know what they are talking about.
Some people are really good at bullshitting their way through stuff. You need to make them actually do stuff to discover they flounder.
And since you can't have them do anything meaningful in an interview (there isn't enough time), anything you ask them to do will be a silly "programming puzzle".
At one place I work at, we're trying to get some senior-level PHP devs... and we're getting some applicants that can't even conceptually do FizzBuzz...