Rules for writers, Tenth edition - Diana Hacker, Nancy Sommers 2021
Use who and whom correctly in questions
Distinguish between who and whom
Grammar
When who and whom (or whoever and whomever) are used to open questions, their case is determined by their function within the question. In the following example, who functions as the subject of the question.
When whom functions as the object of a verb or the object of a preposition in a question, it appears out of normal order. To choose the correct pronoun, you can mentally restructure the question.