That is a good point you bring up. Those certainly are electron donating groups in electrophilic aromatic substitution rxns (b and c), However, in ranking basicity for b and c, the key here is that the lp electrons on the nitrogen can be delocalized on the benzene ring, which stabilizes the molecule (I.e. it would be less likely to accept a proton in an acid base rxn). Further, the electrons in option c can be delocalized to the carbonyl group. In the case of e, the nitro group is very electron withdrawing (in the traditional sense). When you have an electron withdrawing group on an aniline, it further decreases the basicity of the molecule