ANSWER
7 moles of MgO was produced during the reaction
EXPLNATION
Given that;
The number of moles of oxygen is 3.5 moles
Follow the steps below to find the number of moles of MgO
Step 1; Write a balanced equation of the reaction

In the equation above 2 moles Mg react with 1 mole oxygen to produce 2 moles MgO
Step 2; Find the number of moles of MgO using a stoichiometry ratio
Let x represents the number of moles of MgO

Therefore, 7 moles of MgO was produced during the reaction