Even for "crank the handle, produce output" type of jobs, it's a bad strategy to hire idiots since they will not be doing such jobs for the rest of their lives. Projects change. clients change. Technology changes, and only people with at least a minimal amount of adaptability wlll thrive.
And to answer your generic interview question: By running it. If you probe further, things like unit test coverage, integration test coverage, debugging, seed data etc can come into the picture but that depends on your specific question.