How do professors view a student who has good grades but always asks stupid questions? I am planning to apply for Ph.D programs in mathematics in U.S. and I am thinking about which professors I should ask for letters of recommendations from. In order to get "strong" letters, I need to determine which professors believe I am really strong.

Although I do well in most of my classes (I am always trying to get full marks on my homework and tests), I do have a "bad" habit of asking stupid questions frequently. I can see from the faces of professors that they dislike students who always ask stupid questions, while welcoming students to ask questions. (If you are a professor and don't think this is the case, please let me know...I really appreciate it.) I feel like professors prefer the questions that will make them have a better understanding about the subject instead of the questions that they will waste their time on.

What do professors think of a student who has good grades but always asks stupid questions? Should I expect good letters from them? Or I should go to the professors whom I seldom ask questions (but still do well in their classes)?
Students often have a highly distorted perception of themselves with respect to the feelings of their professors.  The differential in both power and experience between student and professor is just so large that it's quite common for a student to confuse the very distinct attributes of professorial attitude, personal affection, and intellectual respect.  

As such, I would suggest that you really don't know what your professors think of you until you ask them.  Maybe you are reading them correctly, but maybe not: many professors are quite pleased to have a student who carefully advocates to improve their understanding of material, even if they might wish to be getting on with the lecture in the moment.

My recommendation is to tell the professor you're thinking of applying to Ph.D. programs and ask them something like:


  Do you think that you would be able to write a strong letter of recommendation for me?


The "strong" is important here, because that's what will get you the honest opinion of whether the professor thinks well of you or not, and you don't want letters that are not strong.