The product "A" and "B" formed in below reactions are:

First reaction proceeds via reaction allowing for carbocation rearrangement. Second reaction proceeds via due to a bulky base and thus no carbocation is formed.
Tagged Nucleophilic substitution (SN1 and SN2). Machine-assigned, so read it as a strong shortlist rather than a verdict.