When to use devoir in the imparfait or the passé composé is very difficult (at least for me). The related lesson in this exercise advises that the imparfait for devoir is used for “supposed to”, and the passé composé is used for “had to” or “must have”. So using that logic, the sentence : “I must have been 3 or 4” should have been translated as “J’ai dû avoir trois ou quatre ans”, but that seems to be incorrect.
Maybe more clarification is needed on that lesson with more examples, because this answer seems to be a contradiction to the lesson .