In the afterword to Different Seasons, King mentions having written Apt Pupil immediately after The Shining.
ɪnðɪ ˈæftɚwˌɜːd tə dˈɪfɹənt sˈiːzənz, kˈɪŋ mˈɛnʃənz hˌævɪŋ ɹˈɪʔn̩ ˈæpt pjˈuːpəl ɪmˈiːdɪətli ˈæftɚ ðə ʃˈaɪnɪŋ.