The correct option is D Ionic way
In Magnesium Oxide molecule, an ionic bond is formed between the atoms Magnesium and Oxygen.
Magnesium has 12 electrons which can be written as 2,8,2, thus Magnesium has 2 valence electrons which it wants to give away to complete its octet by forming the electronic configuration of its nearest inert gas Neon.
Oxygen has 8 electrons which can be written as 2,6, thus Oxygen has 6 valence electrons and it wants to add two more electrons to it to complete its octet by forming the electronic configuration of its nearest inert gas Neon.
Thus Magnesium wants to lose two electrons and Oxygen wants to gain two electrons. Hence Magnesium transfers its two valence electrons to Oxygen and both complete their octet by forming an ionic bond between them.
Magnesium gains +2 charge and Oxygen gains −2 charge.
Thus MgO is an ionic molecule.