Some people get snarky on occasion which is a mean-spirited approach to another human being. I try to never be snarky, because I think it's a cowardly form of communication: never direct, hostile, and intended to ruffle the feathers of the recipient.
When someone treats you in a snarky way that puts you down or makes you feel bad, understand this: snarky people are never truly happy with themselves. Inside, they are hard on themselves - even if they come across as arrogant or narcissistic on the surface - and, in turn, they make themselves feel better by making others feel lower on the social or professional hierarchy.
Never engage with someone who has a habit of getting snarky. The truth is, people who are happy with themselves rarely will get snarky or treat another person badly. The best way to approach snarkiness is to play observer (to think, my, how negative you are!) and to walk away.
If you do find yourself ruffled by someone's snarky behavior, it's a sign that you feel fragile or vulnerable somehow, and the last person you ever want to expose yourself to in such a state is a snarky, bitter individual.