The correct option is A MgO
Lattice energy depends on two important factors. They are:
1. Charge on the ion
2. Size of the ion
On comparing the four given compounds we can see that, MgO and CaO have higher charges (+2 and -2 on the cations and anions respectively) than NaCl and KCl (+1 and -1 on the cations and anions respectively). Therefore MgO and CaO have higher lattuce energies than NaCl and KCl.
Among MgO and CaO, we see that the anions are the same in both the compounds but the cations differ. Since the charge on both the ions are the same, the cation with smaller size will have higher lattice energy. Mg2+ ion has a smaller size when compared to Ca2+ ad thus MgO has the highest lattice energy among the given compounds.