According to grammarly.com, a question mark needs to be within the quotation marks, if it is only relevant to the quote itself, but it has to be outside the quotation marks, if it relates to the whole sentence. Grammarly provide the following examples:
Sandy asked them, “Why do you guys always fight?”
Did the dog bark every time he heard Sandy say “I’m bringing dinner”?
Consequently, answer A is correct, because the question mark applies to the whole sentence, and therefore it must be placed outside the quotation marks.
If a question is being quoted, put the question mark inside the quotation marks. If the words in quotations don’t form a question, but the sentence is still a question, the question mark goes outside the quotations. Don’t use two question marks.