Hi,
I have heard people say 'how do you do? ' when you meet a person for the first time. This is in AmE. Actually, I see this as more typical of BrE. In my experience, Americans are more likely to say 'Hello' or 'How are you' or even simply 'Hi'.
If someone says 'How do you do?' to you, it's quite formal, and the correct response is simply to reply the same way, ie say 'How do you do?'
What does it mean?
I am sure it does not mean 'what are you doing for a living'. No, definitely not. It's just a rather meaningless thing that we say when we meet people. As I mentioned above, other things are also often said as greetings.
If I meet someone for the first time, I am used to saying 'nice meeting you' or 'nice talking to you'. When you meet someone for the first time, you can say (It's) nice to meet you. When you say goodbye to someone for the first time, you can say (It was) nice to meet you. When you meet them again, don't say either of these things.
When you say goodbye to someone, you can say (It was) nice talking to you.
If you search the Forum, you'll find other discussions about ways of greeting people.
Best wishes, Clive