Key idea: A resonance structure is more stable when every atom has an octet, there is less charge separation, and charges sit where they are best stabilised (– next to C=O, + next to the N lone pair). A cation on an electronegative atom with an incomplete octet is the worst case.
- D: every atom has a complete octet. The + is on N (iminium, =NHX2X+) and the – is on the carbon α to CHO, where it is delocalised onto O. This is the most stable.
- B: the – is next to CHO (stabilised) and the + is next to NHX2 (stabilised by the lone pair), but that carbocation has only a sextet. Second most stable.
- A: the + is next to the electron-withdrawing CHO and the – is next to NHX2. Both charges are destabilised, so it is less stable than B.
- C: the + charge is on oxygen, an electronegative atom with an incomplete octet. This is the least stable.
Increasing stability: C < A < B < D.
Answer: (B)