The #1 reason that you do not remember names is not that you have a bad memory it is because you never heard it in the first place. You weren’t focused. In other words, you were thinking about what you were going to say, things in your day, what they are thinking of you and that is why two seconds after they say their name you don’t know what they said. To remedy this get in the habit of asking yourself this question every time you are about to see someone new:
What is their name? What is their name? What is their name?
This will train your brain to be focused