Factors to consider when deciding between SN1 vs. SN2 for reaction of allyl chloride with KCN:
Structure of substrate: Primary alkyl halide favors SN2. However, heterolysis of the C-Cl bond in allyl chloride produces a resonance-stabilized allylic carbocation. Thus, allyl chloride is a nearly ideal substrate for BOTH SN1 and SN2!
Nature of nucleophile: Important for SN2, unimportant for SN1 (why?). Cyanide ion is not only a good nucleophile, it also is linear and thus sterically nonimposing, ideal for participation in SN2 reactions, which are sensitive to steric factors in the substrate and in the attacking nucleophile.
Nature of solvent: Since the rate-determining step in SN1 reactions involves formation of a carbocation, it follows that SN1 reactions are favored by polar, protic (i. e., "good ionizing") solvents.
The extent of solvation of anionic nucleophiles (like CN-) can dramatically affect their reactivity in SN2 reactions. Polar protic solvents stabilize anions by hydrogen bonding, thereby rendering the solvated anion less nucleophilic than the corresponding "naked" anion. Polar, aprotic solvents (like dimethylsulfoxide, and dimethylformamide) are not particularly effective in stabilizing anions, but they can solvate the accompanying cations, which facilitates SN2 reaction.
Jammie's example utilizes allyl chloride + aqueous KCN. In this situation, I'm guessing that the use of a good ionizing solvent (water) will favor SN1 over SN2. However, note that this mechanistic preference could be reversed by changing to a polar, aprotic solvent.
Since water (solvent) is present in huge excess, I would imagine that SN1 hydrolysis to afford allyl alcohol will be a major competing process.
QUESTION FOR JANNIE: What NONKINETIC experiment might you perform in order to determine whether the reaction of allyl chloride + aqueous KCN proceeds via an SN1 or SN2 reaction mechanism?
Hope this helps.