Work experience discussions are the best I’ve come up with.
What I’m suggesting is hire experienced people based on that and resume verification and behavior interviews like nearly every other job on the planet.
And if someone lies about their ability to actually code, fire them quickly.