As a rule, it is impolite to call out someone for asking what we perceive to be a "stupid" question. Anyone with an interest in learning knows that there is no such thing as a stupid question.
However, there are times when a close friend or relative - someone who wouldn't be offended if you poked fun at them - asks a question that you find stupid or unnecessary. In that type of situation, it is still impolite to outright say "What a stupid question!" But it is socially acceptable to reply to the question with a joke of your own that subtly lets the person know that you thought his inquiry was ridiculous or unnecessary.
Some examples:
Me (sitting in the living room, where there is no clock, calling out to my husband who is in the kitchen where there is a large clock on the wall): "What time is it in there?"
Husband: "Same time as it is in there."
(Why was my question deemed "stupid" by my husband? It was simply because of the way I'd phrased my query. I should have simply asked "What time is it?" but for some reason I asked "What time is it
in there?", which was my shorthand way of telling him "Please glance up at the clock and tell me what time it is.")
Co-Worker (asking for driving directions to a restaurant): "How do I get to Hank's Hamburger Hamlet?"
Me: "From here?"
Co-Worker: (rolling his eyes impatiently) "No, from Timbuktu!"
(I didn't immediately understand that Co-Worker was leaving directly from the office to go to the Hamburger Hamlet, which is why I wanted clarification. Co-Worker, without knowing what was going through my mind, thought my question was redundant and irrelevant.)
Again, such sarcastic rejoinders to "stupid" questions should only used among people who know you well - people with whom you regularly share jokes and
barbs. ;-)