Google Translate suggested Kien iras Sofia?
and my Duolingo course gave me Kien Sofia iras
as a correct sentence.
Both are correct questions and both are correct translations of "Where is Sofia going?" Word order in Esperanto is more free than in many other languages, especially usually more than in English.
The default word order in Esperanto is SVO (subject, verb, object), with the exception that question words usually come even before any other. Here we have:
- "Kien" question word about destination
- "iras" main verb (conjugated verb)
- "Sofia" subject
So "Kien Sofia iras?" (QSV) would AFAICT be the "more default" phrasing of the two.
If both are correct, is there a difference in their nuances?
There can be. Some use non-standard word order for emphasis, but not all in a consistent way to each other: Some consider sentence parts moved to the beginning to be emphasized, other consider the sentence parts moved to the end to be emphasized.
More reliably is probably the thema-rema distinction: When non-default word order is applied, first part of the sentence can be considered the "thema" (theme), i.e., the topic of the sentence, assumed to be already known to the audience, while the second part of the sentence can be considered the "rema", i.e., some new or noteworthy information to be conveyed about that topic.
In that interpretation "Kien iras Sofia" would have "Kien iras" as the thema and "Sofia" as the rema. This could mean that several people are being observed to go in different direction (so that people are going somewhere is known to the speaker and the audience), and the inquiry is specifically about where Sofia, who is among the observed, is going.
"Kien Sofia iras", being in the default word order could just be the plain question, or "Kien Sofia" could be the thema and "iras" the rema. This might imply that Sofia is observed (or known) to do several activities involving various directions or destinations, e.g. she's going one way and looking another way, and the inquiry is specifically about whereto she's going.