Types of Bonds can be predicted by calculating the difference in electronegativity.
If, Electronegativity difference is,
Less than 0.4 then it is Non Polar Covalent
Between 0.4 and 1.7 then it is Polar Covalent
Greater than 1.7 then it is Ionic
For MgF₂,
E.N of Fluorine = 3.98
E.N of Magnesium = 1.31
________
E.N Difference 2.67 (IONIC Bond)
For CH₄,
E.N of Carbon = 2.55
E.N of Hydrogen = 2.20
________
E.N Difference 0.35 (Non-Polar Covalent Bond)
For N₂O,
E.N of Oxygen = 3.44
E.N of Nitrogen = 3.04
________
E.N Difference 0.40 (Non-Polar Covalent Bond)
Result:
MgF₂ contains Ionic Bond.