Danielle Brooks, of “The Color Purple” and “Orange is the New Black.” (Ira L. Black)

NEW YORK — Danielle Brooks says that all things happen for a reason. Even the things that go awry in auditions.

Back in 2014, she was up for a juicy replacement role in the Broadway revival of "Pippin," taking over the part of the Leading Player, portrayed to widespread applause by Patina Miller. Unaware that the callback she'd been invited to was for an assemblage of 20 people rather than just a few, she froze. "My nerves got the best of me," Brooks says, finally able, well more than a year later, to talk in detail about the episode. As she groped for the lines she had memorized, she recalls, "I was sinking and sinking." Finally, she just stopped and said to the director, Diane Paulus, "Ms. Diane, this is not my best work."

That was it for her and "Pippin," which would end its run in January 2015. At the time, she says, sitting affably in a corner table in the Algonquin Hotel restaurant on West 44th Street, she was "super-devastated." "That was a wake-up call for me," she adds, explaining that what she concluded some time after she departed the audition room was, "I can either give up, or work harder."

Option Two was the one she chose, and, as she demonstrates nightly in her rafter-raising turn as Sofia in the critically acclaimed Broadway revival of "The Color Purple," it was an alternative that has paid off for her as well as for musical-theater audiences. The adaptation of Alice Walker's novel had its official opening in December with Jennifer Hudson as Shug, Cynthia Erivo as Celie and Brooks as the revival's not-so-secret weapon. Her public profile high as a result of her three seasons on the hit Netflix series, "Orange is the New Black," playing the troubled but charismatic inmate Taystee, the 26-year-old Juilliard graduate did not make her Broadway debut as an unknown quantity. Still, few theatergoers knew what they were in for when Brooks revealed herself so capable of embodying the show's fiercest character, a powerful woman tired of the abuses heaped on her and who expresses her fury loudly and clearly in the Act 1 anthem, "Hell, No!"

"She's the one who is fearless," Brooks says, "who does not give a hoot about anything. And she's been the best person I could have stepped into the shoes of."

Brooks herself seems as mild mannered as Sofia is formidable. Her easygoing nature is in some ways at odds with the rapid advance of her career — an ascent that surprises even her. "I thought it was going to be like: 'Danielle struggling till she was 40,' " she observes, laughing. Instead, it's been breakthrough after breakthrough. Born in Georgia and raised in Greenville, S.C. — her father works for BMW and her mother is a schoolteacher — Brooks sang in church choirs and got serious about the actor's life she'd always dreamed about when she was accepted into Greenville's prestigious South Carolina Governor's School for the Arts and Humanities. She was, she says, the only black student among the 15 accepted into the theater program that year, and, coincidentally, it was the same program from which Patina Miller graduated, a few years earlier.

Without knowing too much about Manhattan-based Juilliard — one of the most selective drama conservatories in the country — Brooks got in (after a far more productive experience with auditions). The summer before her senior year of high school, she visited New York for the first time, and took in her first Broadway show. Looking back, she says, it was Kismet: the show she and her father got tickets to was the original mounting of, yes, the musical version of "The Color Purple," which ran until 2008.

The rigors of Juilliard, which she entered at the age of 17, helped her to grow up in a hurry. And then, after she went out into world, in customary New York actor-fashion, she waited tables: "I was the worst waiter ever," she says, cracking up at the memory. "I would have to call people over to help me open a bottle of wine."

Her stage career began in the classics: she was cast in a 2012 comedy dell'arte production of Carlo Goldoni's "The Servant of Two Masters," a co-production of Washington's Shakespeare Theatre Company and Minneapolis's Guthrie Theatre. Not too long after came the door-opening offer of the recurring role on "Orange is the New Black," whose fourth season she will soon begin shooting. During rehearsals for "The Color Purple," she had to divide her time between "Purple" and "Orange," and despite the grueling schedule, the two assignments never managed to, er, clash. Brooks lives in Brooklyn and, during her yearlong contract with the musical, she prefers commuting to the Bernard B. Jacobs Theatre on the subway. The routine, she admits, has been getting harder because she's so often stopped by people who want to talk about Taystee or Sofia. Though she appreciates the attention, she says, she'd love to figure out how to balance the public aspects of her job with a desire for some private time.

It's taken just one shot in each of two mediums — one TV series and one Broadway show — for this kind of enviable dilemma to crop up in Brooks's life. She knows how lucky she is. "I'm humbled by it all," she says. "I don't take for granted how many people would love to be in this position. Because here I am, with two dream jobs."

Danielle Brooks as Sophia and Kyle Scatliffe as Harpo in “The Color Purple.” (Matthew Murphy)

The Color Purple, book by Marsha Norman, music and lyrics by Brenda Russell, Allee Willis and Stephen Bray. Directed by John Doyle. At Bernard B. Jacobs Theatre, 242 W. 45th St., New York. Call 212-239-6200 or visit telecharge.com.