Aja Naomi King for NY Times in 2014

“I wanna be her,” Michaela Pratt, a young law student, utters in admiration when her professor, Annalise Keating, defends a client on an attempted murder rap — and, in a maneuver of brazen audacity, wins.

But Aja Naomi King, who plays Pratt, might have been talking about Viola Davis, the Oscar-nominated powerhouse breathing life into Keating, one of the season’s most striking protagonists, in ABC’s new “How to Get Away With Murder.”

Ms. King had an M.F.A. from Yale and recurring roles on CW’s “Emily Owens, M.D.” and ABC’s “Black Box” on her résumé when she landed the role of Pratt after a Skype audition in which everything — the Internet connection, the sound — went wrong.

Yet, she’d scarcely left the room when she was offered the part.

“Words can’t describe how one would feel in that moment after doing a test for something you really want but in your heart you don’t think you have a chance of getting,” she said. “I wanted to cuss, but I was still inside this building.”

And when she found out that Ms. Davis had been cast as the lead?

“I believe I said I would just die,” Ms. King, 29, told Kathryn Shattuck in a telephone interview from Los Angeles, not far from where she grew up. Getting the chance to work with Ms. Davis, the show’s creator Peter Nowalk, and Shonda Rhimes, one of the executive producers, “it’s like: ‘I’m done. That’s all I’ll ever need.’ ” These are excerpts from their conversation.

Q. You’ve described landing the role of Michaela Pratt as a dream come true. Why?

A. She seemed so fun, and it looked like there was so much potential there. And knowing who was creating these characters, you just immediately know that there are going to be layers of depth to each one. She has a way of acting really full of herself when in reality she’s just trying to prove herself and is always looking for that recognition — really needing someone to see her, see how hard she works, because she wants this so badly. And I feel that she has the most human reactions to the things that happen in this show that I cannot yet tell you about. [Laughs.]

In the pilot’s opening scenes, Pratt is seen arguing with her classmates about how to dispose of a dead body. Is she perhaps the show’s moral compass?

Honestly, I wouldn’t say that anyone at the end of this will be any kind of a moral compass. There are people who do what they believe is right, but as they say, “The road to hell is paved with good intentions.” It’s kind of this desperate need for survival in these moments.

Growing up, you wanted to become a doctor. Why the change of heart?

When I was younger, my mother tried to get me an agent because I was always singing and dancing, but whenever she took me to an audition, I would just shut down. By high school, I was telling everyone, “Oh, I’m going to be a doctor when I grow up,” because my dad was always saying to me, “Pick a career path where you’re always going to be necessary.” But by junior year, I was president of choir, I was the lead in the school play, and I just loved being onstage performing. I literally had a breakdown because I’m not big on denying myself the things that I want, and I knew I was going to do it anyway. So it was coming to terms with the fact that my life was never going to be stable. I’d never know where the next job was coming.

Does Ms. Davis ever offer acting advice?

Viola will definitely share stories of her own experiences. But she doesn’t try to say, “Do the scene this way.” It’s more like leading by example, and that in itself is a master class. You’re watching a true, Juilliard-trained artist, seeing how she’s breaking down a character. She doesn’t realize how she blows my mind sometimes.