Structure of exotic nuclei in the sd-pf shell region and its relation to the effective interaction