The interview process is a two way street, and a good onsite will include time for an applicant to talk to a manager at the company which will give you time to determine if that manager is competent, as well as a good fit.
Furthermore the interview test "FizzBuzz" was announced back in 2007, yet there are applicants who claim they can program but still fail such a basic test. (Failure modes include the applicant thinking they are "too good to take the test" and refusing to trivially demonstrate they are able to code. Choose your reaction carefully.)