This is a real problem. If you are hiring coders you have to have a couple people in the team go deep on coding chops to ferret out the charlatans. Personally I like to show people a piece of code from a big system they've never seen and let them walk me through what it does and what they would change to make it work better. Some teams I work with also give 'homework' exercises, which I believe is fairer than trying to do it in front of somebody else. (Unless that's how you actually write code on a day to day basis.)
Good interview processes reflect complementary broad and deep concerns. It's kind of analogous to the way a strong team is better than the sum its parts.