"What do you have to do?"
Translation:आपको क्या करना है ?
This is not a literal translation and Hindi does not have an equivalent of the verb 'have'.
You can think of the '[Noun+को/dative-case pronoun] [verb-infinitive] [होना] ' construction as being idiomatic and meaning '[Noun/pronoun] has to [verb]' or '[Noun/pronoun] wants to [verb]'
It is used only in colloquial Hindi.
While formal/standard Hindi is mostly set on word-order, in colloquial spoken Hindi, you can play around with the word order to communicate various subtleties in meaning. This is also usually accompanied by a suitable inflexion of speech (in the absence of which the sentence with nonstandard word-order may sound unnatural). Because these unfamiliar subtleties in meaning can be a source of confusion for new learners, Duolingo does not consider colloquialisms as correct and insists on formal/standard Hindi.
In the case of आपको करना क्या है?, the changed word order can be used to express exasperation, usually by placing stress on करना while speaking.