Magnetic interactions in compositionally modulated nanowire arrays