Answer: D. D is correct. In allyl carbocation, the empty p-orbital on the terminal carbon overlaps with the adjacent C=C π-system, delocalising the positive charge. This resonance stabilisation is more powerful than the hyperconjugation from 3 α-H in ethyl carbocation.
Why A is wrong: A is wrong because allyl has no α-hydrogens available for hyperconjugation, fewer than ethyl's 3, so hyperconjugation cannot be what stabilises it — and chain length is irrelevant to hyperconjugation strength (trap: assuming longer chain = more stable).
Why B is wrong: B is wrong because a primary carbocation has no significant steric shielding — and stability here is electronic, not steric (trap: invoking steric arguments for electronic-stability questions).
Why C is wrong: C is wrong because the vinyl group (sp² carbon) is weakly electron-withdrawing by induction, not donating — inductive effect here would destabilise, not stabilise (trap: attributing resonance stabilisation to inductive effect).