What is the reaction priority when methyl 2-(chloromethyl)benzoate reacts with potassium cyanide?

I was going through some PYQ'S of JEE Advanced where I encountered this question.


[![enter image description here](https://i.stack.imgur.com/UKRJB.png)](https://i.stack.imgur.com/UKRJB.png)


I was not able to decide whether I should go for an SN2 reaction to substitute $\ce{-Cl}$ or a nucleophilic attack on the ester.


The solution provided by a reputed coaching center says that we should prefer the nucleophilic attack on the ester but I don't understand why.


What is the reason for this?




I would prefer to go along with $\mathrm{S\_N2}$ because the benzylic carbon is much more electron deficient than the carbon associated with the ester. This is because the phenyl ring is made up of $\mathrm{sp^2}$ carbons, which are more electronegative than the $\mathrm{sp^3}$ benzylic carbon. Thus it exerts a *negative inductive* effect which decreases the electron density on the carbon. The same effect, albeit much stronger, is also exerted on the same carbon by the chlorine.


On the other hand, the acyl carbon of the compound receives a *positive mesomeric* effect due to the phenyl ring. This should somewhat stabilise the electron density on the carbon atom. Here’s a diagram; check out the last three canonical forms: [![enter image description here](https://i.stack.imgur.com/vye2e.png)](https://i.stack.imgur.com/vye2e.png)


Thus, the benzylic carbon, with lower electron density , is much more susceptible to the $\ce{CN^-}$ nucleophile and hence the reaction should favour an $\mathrm{S\_N2}$ pathway. Then cyanide and ester hydrolysis give the respective acid groups.


 7