Parenting can be a political minefield, and everyone has their own opinion which they would often like to shove down your throat. If the interferon happens to be your grandma, other relative, boss, or someone else you want to be polite to for some reason, stuff can get tricky. What's the best way to avert nosy questions without offending the other party?
1. Realize that people who talk about parenting small kids are often simply sharing their own experiences. When someone talks about how you should really do X, Y, or Z with your baby or toddler (sleep training, attachment parenting, babywearing, dressing them up in lace, or whatever), all they're normally saying is that this is what they did, and it worked for them.
Trying to impose one's opinions can also be cultural... and the opinions some old lady on the street is spouting may not even be hers, either. We had a terrible time with our newborns because old ladies kept commenting that we were doing stuff wrong, whether it was nursing them, having them in a baby carrier, having them in a stroller... or even the presence or absence of socks in hot weather. When criticizing other folks is culturally expected, the only way to deal with it is realizing it's really not about you or your parenting skills, in the slightest.
2. Being confident in yourself and your own parenting really does work. A bit, anyway. When you feel good, you're less likely to be defensive and want to yell at people who are rude to you. New moms who have done lots of research about the usual controversial points (eating, sleeping, infant development) may be tempted to be share their knowledge in a discussion. I found that is counterproductive, and smiling and saying you are doing what works for you makes the irritation go away much faster.
3. In family settings, "thanks", "oh, that's interesting", and "I'm glad you found something that works for you really works wonders. The more direct people who keep insisting you comment on their offensive statements will need you to be persistent and keep repeating the same thing over and over again. "Pass the bean dip" is a good thing to say. If need be, say outright that the topic in question is not open for discussion.