Count carbons and functional groups. Two acetaldehyde molecules (2 x C2) combine to give a C4 product, which rules out acetone (C3) in (3). Base-catalysed aldol reaction retains the carbonyl and adds an OH group, so A is C4H8O2. Heating eliminates water, giving C4H6O, with a C=C conjugated to CHO. Butan-1-ol (1) and butane (4) would need reduction, which no reagent here supplies. Only CH3CH=CHCHO (C4H6O) fits.
Answer: (2) CH3-CH=CH-CHO