Both “what do you do?” and “where are you from?” are very loaded questions that will cause quite a few people offense.
The former […] combines both the American presumption that one’s job/career is a person’s single most definitive characteristic and is effectively a query about class. Sure, in its most benign [form] it’s an unselfish attempt to ask a person about something that is presumably both important and interesting to themselves. But not everyone, and certainly not at all times in their lives, finds work very interesting and wants to discuss it with strangers and, not infrequently, people have jobs they specifically dislike discussing (or disclosing) to strangers. And, at worst, it’s an opportunity for a stranger to stereotype you on the basis of your work and to invoke all the class and status stuff that one’s work implies.
The latter seems like an entirely innocuous, even quite friendly and considerate question to people who are accustomed to feeling like they belong to and are welcome in the community in which they are embedded. But not everyone has this privilege. Many people are frequently seen as out-group by the people around them — even when they’ve existed in a community their entire lives. For all such people, “where are you from?” is a coded (and sometimes quite explicit and hostile) message of “I think you don’t belong here”.
And the unfortunate thing about these two questions and about personal questions in general is that they’re not necessary. If you genuinely want to better know someone, or genuinely wish to make them feel at ease by signaling that you’re interested in who they are and what they have to say, all you need to do is listen. Well, you need to actively listen and to present the various social conversational signals that indicate receptiveness and interest. If you do, people will talk to you. And it’s a truism that most people, to varying degrees and with various amounts of circumspection, like to talk about themselves. At the very least, everyone likes to talk about the things they are most interested in. It’s not that hard to provide opportunities for people to feel comfortable opening up. Direct questions that implicitly raise problematic issues like class and belonging are among the worst tools for this purpose.
—Keith M Ellis, in his answer to a MeFi post on social greetings.