On her Hulu show "The Mindy Project," actress Mindy Kaling's character, Mindy Lahiri, oozes confidence even though she never quite seems to have her life together.

In reality, Kaling admits confidence was harder to come by.

Growing up in Cambridge, Massachusetts, she wasn't considered "traditionally cute," says Kaling, 39, at the Glamour Women of the Year Summit in New York City on Nov. 11. While that was sometimes painful, Kaling says it actually taught her the importance of confidence, which was key to her professional success later in life.

"I didn't have to worry so much, 'Oh what would the boys think of me?' because the answer was, well they think I'm ugly," Kaling says.

"When you are ignored in that way, one of the things that happens is confidence and asking for things based on your professional career — they come a little bit more easily for you," she adds. "At least that was the case with me, because I felt like, you know, this is my only path."

Since her breakout role as Kelly Kapoor in NBC's "The Office," Kaling has gracefully ascended to stardom, snagging numerous Emmy nominations, starring in major movies like "Ocean's Eight" and penning best-selling books including "Why Not Me?"

But innate confidence is something that Kaling says she doesn't fully understand.

"We tell young women...to be confident, be confident, and to just grasp it out of thin air, and I think that's confusing," Kaling admits.

"Because for me I've never had any [innate] confidence," she tells NBC's Savannah Guthrie and Hoda Kotb at the event. "I've just done the leg work. It often meant that I never came to anything unprepared."

"I literally could not be confident with the amount of research and preparation that I had done," Kaling said. "And then I felt confident.

"I think that's sort of been the key to everything in my life."

Guthrie, host of "The Today Show," agrees. "The work is the confidence," Guthrie says. "Confidence isn't some slogan that you say that has no meaning and is like a bumper sticker. Confidence is earned."

Guthrie says confidence also comes from life experience. "[C]onfidence comes from surviving breast cancer..." she says, acknowledging her co-host Kotb's 2007 diagnosis, and it comes from age. "Because I think the older you get, you're just like acquiring it with experiences that let you know, I can survive."

Disclosure: CNBC parent company NBCUniversal is an investor in Hulu.

Don't miss: How Kevin Hart went from sleeping in the hallway of a one-bedroom apartment to making millions

Like this story? Subscribe to CNBC Make It on YouTube!