The given reaction is a nucleophilic substitution reaction.
With ethanolic KCN, allyl bromide and ethyl bromide reacts to form nitrile compound. Chlorobenzene and vinyl bromide does not react as they have = bond and the bond is shorter and stronger cann't be replaced by CN group.