Have them explain their code to youHave them explain their code to you before you help them, or just point them to Stack Overflow and the crowd will tell them to do the same thing.
Unless the questions are routinely so basic that you get absolutely nothing out of answering the questions yourself, then I'd still consider helping once in a while (if it's clear that the people you're helping are at least trying). The best way to make sure you understand something is to teach it.