Exactly my doubt. Even though Duo says in the Tips section that the question comes last in a sentence structure, which would answer your present query, but I've seen in some sentences that the question comes first in those sentences.
I think that the question word comes before a specific word you ask for. When you ask for dogs, then it comes before the dogs otherwise you would ask for the person. This was my observation, but I am still nor really sure.