Faut and faire here correspond to should and do. You are mistaken that quel translates what (the correct pronoun is usually que or quoi). It in fact corresponds to which.
Il here serves as a dummy subject, because falloir is an impersonal verb in french. It gives you trouble because although the English sentence is an accurate and idiomatic translation, the literal french form (which is grammatical, but seen as very stilted because contemporary spoken french avoids using nous) would be Quel exercice devons-nous faire?.
“Il faut” is a whole expression, you have to use it as a whole.
The il is the impersonal form. It’s not always it, it can be one sometimes.
An equivalent could be “On doit” (translated in English by “one should”, “one must” depending on the sentence).
Il faut faire un exercice = We have to do an exercise. We must do an exercise.
In French, it will be the same “il faut” for an advice and for a strong obligation.
So “Quel exercice faut-il faire/doit-on faire ?” (the more formal and correct form) or “Quel exercice il faut faire ?”, etc, are constructed with “Quel exercice” + the whole “il faut” or “faut-il” expression.
Faut-il faire l’exercice de math ?
Doit-on faire tous les exercices de la page ?
All these forms are formal.
On doit apprendre cette leçon ?
Est-ce qu’on doit faire les exercices ?
Il faut faire quel exercice ? and Quel exercice il faut faire ? are the same but the first one is very informal.
Quel translate to what OR which, depending on the sentence.
- Which exercise should we do? = Quel exercice devons nous faire ?
Because lequel is only used when you have a clear choice:
- Je prends un crayon sur la table. Lequel ? (which one?).
Lequel is NEVER a question word. So, it’s easy when you have which in a question, it’s always quel.
To know how to translate,
- ask yourself whether there is a clear choice between several things.
- and whether it’s a question word.