Hong Wang, one of this year’s winners of the Fields Medals, which honor the top mathematicians under the age of 40, once considered giving up on math and becoming an architect instead.

After graduating from Peking University in 2011 with a degree in mathematics, she went to École Polytechnique in France to pursue a master’s degree, but had her doubts. “I don’t know if I have enough talent,” she recalled thinking.

For a semester, she even avoided math and did a one-month internship at an architecture firm. Then she returned to mathematics. “I realized that studying architecture from zero is not easy, either,” she said.

Today, Dr. Wang, 35, is a professor of mathematics at New York University and the Institut des Hautes Études Scientifiques in France. Of the 68 recipients of Fields Medals, she is only the third woman to be honored.

“You just stop thinking about it, stop questioning yourself and focus on the work,” she said of overcoming her earlier career indecision.

Dr. Wang is best known for a proof that she and Joshua Zahl, now a professor at Nankai University in China, posted online last year involving a problem known as the Kakeya conjecture.