Answer: B
P is 2-hydroxybenzaldehyde (Reimer-Tiemann) and Q is 2-hydroxybenzoic acid (Kolbe-Schmidt). Both have a phenolic OH, so both give a violet colour with FeClX3, react with sodium and dissolve in NaOH. Only the carboxylic acid Q liberates COX2 from NaHCOX3.