Show the formation of by transfer of electrons.
Part 1: Electronic configuration of magnesium:
In order to obtain an octet configuration, it will lose two electrons.
Part 2: Electronic configuration of oxygen:
In order to obtain an octet configuration, it has to gain two electrons.
Part 3: Formation of Magnesium oxide :