Molecule Q is an acyl chloride
Molecule P is NOT an acyl chloride
How can we differentiate between them in a test-tube reaction?
Mix with water!
When acyl chlorides react with water it creates white misty fumes (HCl gas released) - Page 188 of CGP Book
Molecule Q will release white misty fumes.
Molecule P will NOT release white misty fumes