Identify A and B in the chemical reaction.

Alkyl iodides are often prepared by the reaction of alkyl chlorides/bromides with NaI in dry acetone. This reaction is known as the Finkelstein reaction.
R-X + NaI R-I + NaX
(where X = Cl, Br)
Tagged Nucleophilic substitution (SN1 and SN2). Machine-assigned, so read it as a strong shortlist rather than a verdict.