Nucleophilic substitution reactions can occur through either an SN1 or SN2 mechanism. The SN1 reaction is a two-step process where the first step is rate-determining and involves formation of a carbocation intermediate. It is a unimolecular reaction that results in loss of configuration. The SN2 reaction is a single concerted step where nucleophilic attack and leaving of the existing group occur simultaneously through a trigonal planar transition state. It results in inversion of configuration. Both mechanisms are affected by factors like the substrate structure, the nucleophile, the leaving group and the solvent used.