My first-year CS student self would have agreed with you; I had several experiences where I (a minority student in CS) had to work with overconfident white male students who always felt the need to explain things to me that I already knew. Looking back though, these experiences have made me a more resilient person when dealing with difficult colleagues and peers I'm forced to work with.
I've always loved teaching peers because it reinforces my knowledge of the concepts being taught and gives me a sense of satisfaction. On the flip side, I feel small and maybe a bit ashamed if I'm less skilled than my partner, but if my partner's nice enough to explain things to me, then I come out with a better understanding of the concepts and a good relationship with my peer. Either way, it's a win-win situation, even if it doesn't feel that way in the moment.
I felt this. Pair programming can be taxing in that you don't know if you come across to your partner as knowledgeable, or, as my friend recently put it, "a wind bag." My main weapon against impostor syndrome is to turn everything into a learning experience. The way I deal with it is to explain my thought process as deeply as possible, laying out all my cards on the table. This way, the other person/people can help me tweak my understanding as I speak, so I'll emerge from the experience better equipped to speak about the topic at hand. I feel that impostor syndrome will never go away, and in some ways this is a blessing because with it comes an everlasting desire to keep learning and stay humble.
I've always loved teaching peers because it reinforces my knowledge of the concepts being taught and gives me a sense of satisfaction. On the flip side, I feel small and maybe a bit ashamed if I'm less skilled than my partner, but if my partner's nice enough to explain things to me, then I come out with a better understanding of the concepts and a good relationship with my peer. Either way, it's a win-win situation, even if it doesn't feel that way in the moment.