Sixty-two-year-old PepsiCo CEO Indra Nooyi just announced that she intends to step down in October, passing the top job to the company's president, Ramon Laguarta. By every conceivable measure, Nooyi has been a stunning success. Born in India, she was both the first woman and the first immigrant to hold the top job at PepsiCo. When she took over as CEO, PepsiCo became the largest company ever led by a woman.

She held that position for 12 years, whereas the average large-company CEO tenure is five years, according to a recent Harvard study. Sales during her leadership grew 80 percent. She managed the acquisition of Quaker Foods, a key step for PepsiCo as trends toward healthier eating (and drinking) cut into the profitability of sodas and potato chips. Perhaps most impressive, she faced down activist investor Nelson Peltz, who led a relentless two-year campaign to force PepsiCo leadership to split up the company, separating its soda division from the more profitable Frito-Lay.

Now that the famously hardworking Nooyi is leaving, she has one big piece of advice for today's college students and recent graduates--and she says that doing this contributed a lot to her own success: Study STEM subjects. In an interview early this year with Freakonomics Radio, she explains. 

One of the things that my experience has taught me is that if you are trained as a scientist in your youth--through your high school and college--if you stay with the STEM disciplines, you can learn pretty much all of the subjects as you move along in life. And your scientific disciplines play a very important role, and grounds you very well as you move into positions of higher and higher authority, whatever the job is. It's very hard to learn science later on in life. One of the pleas I would have for most young people today is, stay with STEM as long as you can.

This is pretty much the opposite of the advice offered by Mark Cuban, Slack CEO Stewart Butterfield, and LinkedIn engineer Guy Berger. These and other experts argue that STEM studies tend to be too specialized, and too focused on the skills needed today (data science for example). They say it's impossible to tell which skills will be desirable in the years to come, and that artificial intelligence will in time take over some of the STEM tasks currently performed by humans. That's why they think a liberal arts education, by teaching students to be flexible, to be good at communication and creativity, and to see the big picture, are ultimately more valuable.

You might think these skills would be particularly useful at a consumer products company. PepsiCo isn't IBM after all. And Nooyi does have not one but two master's degrees in management. But she says there are countless times when her undergraduate degree in physics, chemistry, and mathematics helped her make her company more successful. For example, when she hired endocrinologist Mehmood Khan as the company's chief scientific officer, her science background helped her better understand what he wanted to do and explain it to others at the company. 

It also helped her make the company more innovative. "I could also challenge the R&D department to do things that they enjoyed doing," she explains. "Very often I'd write them a note saying, 'Look, I have six challenges I'd like to give you. And this is why I'm putting these challenges out to you.' And they loved it." One of those challenges was to recapture some of the fiber lost in the leftover pulp when squeezing oranges for orange juice, and put that fiber back into the juice to make it healthier, something her research team did accomplish. "And the list goes on and on," she says.

So, while you shouldn't necessarily expect that STEM job you're studying for to still exist a decade from now, getting an early grounding early in science, mathematics, and technology might stand you in very good stead for the future--even if, like Nooyi, you wind up in a non-STEM role.