The \(CH _3\) group with positive \(N\) atom is more electron deficient and to more reactive towards the nucleophile.
\(\left( CH _3\right)_4 N ^{+} I ^{-}+ OH ^{-} \stackrel{ SN ^2}{\longrightarrow} CH _3 OH\)
$C{H_3}C{H_2}C{H_2}OH\,\xrightarrow{{PC{l_5}}}\,A\,\xrightarrow{{alc.\,\,KOH}}\,B$