Answer:
Explanations
Ionic compounds are formed when a metal react with a non metal while covalent bonding occur between compounds containing non-metals.
MgCl2 is therefore ionic compound not covalent due to the large difference in the electronegativity value of the elements.
BeO on the other hand can partially form a covalent compound due to the presence of non-metals.