Oxygen atom will strongly attract the shared pair of electrons towards itself.
Explanation:
The bond formed between magnesium and oxygen atom is an ionic bond.In this type of chemical bond transfer of electrons takes place from one atom to another.
Electronegativity : tendency to attract shared purr of electrons towards itself.
The transfer of electrons from one atom to another type of an atom depends upon the electronegativities of the atoms.
Higher the electronegative character in an atom more will be the tendency of that atom to attract the electrons towards itself and form electronegative ion.
Lower the electronegative character ,more easily it will donate its electrons and form a electropositive ion.
Out of magnesium and oxygen, oxygen is a second most electronegative element in a periodic table which means it will easily attract the shared pairs of electrons towards it self.