Solution:
Concept: An electrovalent (ionic) bond forms when one or more electrons are transferred from a metal atom (which becomes a positive ion, a cation) to a non-metal atom (which becomes a negative ion, an anion). The oppositely charged ions are held together by strong electrostatic forces of attraction. A covalent bond forms when two atoms (usually of non-metals) share one or more pairs of electrons, each atom putting the same number of electrons into the shared pair(s). Each atom counts the shared electrons in its own outer shell, and so reaches a noble gas configuration.
Step 1 — Identify the elements.
W (2, 8, 1) is sodium, which loses 1 electron; X (2, 8, 7) is chlorine, which gains 1; Y (2, 5) is nitrogen, which needs 3; Z (1) is hydrogen, which needs 1.
Step 2 — Bond between W and X.
(a) 1. W transfers one electron to X, forming W⁺ and X⁻, so the bond is electrovalent (ionic).
W→W++e−
X+e−→X−
Step 3 — Bond between Y and Z.
(a) 2. Both Y and Z need electrons, so they share. Y shares one pair with each of three Z atoms, giving YZ₃ (NH₃): a covalent bond.

Step 4 — Formula of the X–Z compound.
(b) 1. Z and X share one pair, giving ZX (HCl), a covalent compound.
Step 5 — Formula of the W–X compound.
(b) 2. Both ions carry one unit of charge, so the formula is WX (NaCl).
Therefore, (a) W and X form an electrovalent bond and Y and Z a covalent bond; (b) the formulae are ZX (HCl) and WX (NaCl).