By the time he arrived, she ______ for over an hour.
Correct: A
This sentence describes an action ("waiting") that started in the past and continued up to another point in the past ("he arrived"). The past perfect continuous tense (had been + -ing verb) is used to show duration leading up to a specific past event. "Has been waiting" is present perfect continuous, and "was waiting" (past continuous) or "waited" (simple past) don't convey the duration leading up to the arrival.