Formal:
* 你为什么在这里? (nǐ wèishénme zài zhèlǐ?) - This is the most direct and literal translation, suitable for formal situations.
Informal:
* 你怎么在这里? (nǐ zěnme zài zhèlǐ?) - This is a more casual and natural way to ask the question.
* 你来这里干什么? (nǐ lái zhèlǐ gàn shénme?) - This phrase literally means "What are you doing here?" and is more direct in inquiring about the purpose of the person's presence.
Additional options:
* 你在这里做什么? (nǐ zài zhèlǐ zuò shénme?) - This literally means "What are you doing here?" and is a more general way of asking.
* 你怎么会在这里? (nǐ zěnme huì zài zhèlǐ?) - This means "How come you're here?" and expresses surprise.
It's important to choose the appropriate phrase depending on the situation and your relationship with the person you are speaking to.