what/which

where should i use these two when asking stuff? sometimes i think they are interchangeable, like this case:

what city are you in?
which city are you in?

or

what city are you living in?
which city are you living in?

maybe in these last two its different…

Both are fine in this case. You would generally use which if you have a certain limited number of choices in mind, what when possibilities are open.