The first step is a simple condensation reaction. The last step is an example of ElcB mechanism and the leaving group is hydroxide, which is unusual. Still this step manages to take place owing to the stability incorporated therein the product, whichis a conjugated carbonyl compound.