smart alec
informal
someone who is always trying to seem more clever than everyone else in a way that is annoying.
Some smart alec in the audience kept making witty remarks during my talk.
Cambridge English Idioms Dictionary