Still I think that would become obvious pretty quickly. I've actually had people start writing out a textbook algorithm that just solved the wrong problem. And then completely stumbled when trying to explain how the program would arrive at the intended result.
I usually ask questions until the person is out of his comfort zone, and if he is completely clueless on how to proceed at that point it's a red flag.