Draw the structures of organic compounds A and B. Omit all of the byproducts

Draw the structures of organic compounds A and B. Omit all of the byproducts.

image

Concepts and reason
This problem is based on the concept of Grignard reagent reactivity.
Grignard reagent is a very good nucleophile in case of carbonyl compounds. It is made up by the reaction of haloalkane with Mg in the presence of ether. It attacks on carbonyl compounds followed by the treatment with water and forms corresponding alcohol.

Fundamentals
In order to predict the reactant from product, the reaction should be written backwards (from product to reactant).

Answer:
The reaction is given below:
image

The product contains five carbons in which two carbons came from the acetaldehyde and three carbons came from a nucleophile that is propyl magnesium bromide.

Do not start identifying reactants from the first step of synthesis. Predicting the reactant from the last, one by one is easy.

The first reaction of synthesis is given below:
image
image

In this synthesis, propyl bromide molecule undergoes a chemical reaction with Mg in the presence of ether in order to form Grignard reagent which on reaction with acetaldehyde followed by the treatment of water forms an alcohol which pentan-2-ol.