And we unwittingly perpetuate these gender stereotypes, and the resulting psychological barriers they create, in the ways we socialize our children, Ms. Saujani said. “So if women are waiting to be perfect to lead,” she said, “we’ll never close the leadership gap.”

And that gap is not narrowing. Women in senior leadership positions are dramatically outnumbered by men, according to a 2018 report on women in the workplace from McKinsey & Company that found only about one in five C-suite leaders is a woman (only one in 25 is a woman of color).

Yet when women propel themselves toward senior leadership positions it can backfire, said Alicia Menendez, who shared the stage with Ms. Saujani. She is the author of the forthcoming book “The Likeability Trap.”

Women often question whether or not they are “good enough” professionally, Ms. Menendez said, but the question could also be “do other people think I am good enough?”

When she began researching her book, Ms. Menendez imagined that professional women who didn’t care whether they were well-liked were “living their best lives and marching to the beat of their own drummer.”

But the reality, she said, was that they, too, “pay a price for being brazenly themselves, especially women who are ambitious and strive to lead. And that often happens in the early part of a woman’s career.” These women start out confident and eager, with lots of new ideas, but soon learn that others see something wrong with the way they conduct themselves.

“She is either too soft, too warm, not seen in the eyes of other people as a leader, or too strong, too assertive, too aggressive, too much,” Ms. Menendez said. “The problem is not that she’s doing it wrong, it’s that it’s nearly impossible for a woman who strives to lead to do it right.”