The atomic number of X=20
The electronic configuration of X=2,8,8,2
Since the valence shell of X contains two electrons in the valence shell. Therefore, it loses two-electron to attain noble gas configuration and forms a dispositive ion.
The atomic number of Y=17
The electronic configuration of Y=2,8,7
Since the valence shell of Y contains seven electrons in the valence shell. Therefore, it gains one electron to attain noble gas configuration and form an anion.
Hence, one atom of X combines with two atoms of Y to form a compound XY2.
Since the bond is formed by the complete transfer of electrons. So, the bond is ionic in nature.
Electron - dot structure :