The major product expected from the following reaction is :

From the JEE Main 2017 · 8 Apr · Shift 1 paper. Try it, check your answer, then read the worked solution below.
The major product expected from the following reaction is :

Try it yourself first, then check your working against this.
Worked solution
HCl catalyses lactonisation between the group and the neighbouring (Fischer esterification inside the molecule, forming a five-membered lactone). The amide is much less reactive toward acyl substitution and stays, and the phenolic OH is not replaced. That is structure (3).
Concepts used: lactonisation, relative reactivity of acid and amide
Every past question tagged to the same part of the syllabus, with solutions.
Past questions on the same topic (Acid derivatives), each with a worked solution.
Timed, in the real format, and marked the moment you submit.