Greeting someone you never met:
"Hi, my name is Steve. It's nice to meet you."
You can respond to this by saying,
"It's a pleasure to meet you. I'm Jack."
Another common question to ask is
"What do you do for a living?"
You can respond to this by saying,
"I work at a restaurant."
"I work at a bank."
"I work in a software company."
"I'm a dentist."
Usually, you will not need to ask for a name. It is implied that each person should say their name. But in case they don't, you can ask,
"What is your name?