Q is giving effervescence with sodium bicarbonate, it means Q contain carboxylic acid functional group. The compound R is reacting with Hinsberg's reagent and giving solid which soluble in sodium hydroxide means R contain primary amine functional group. Hence, The compound Pcan be a secondary amide. The overall reaction is shown below.





