By Carol Bartz

(FORTUNE Magazine) – Carly Fiorina's ouster makes Carol Bartz the most prominent woman in American technology. A Silicon Valley veteran, she became CEO of Autodesk 13 years ago and has since radically expanded its product line to include software for designing and manufacturing everything from skyscrapers to spoons. (In case you're keeping track, no CEO who is not a founder has served longer at any major tech company.) And last year Autodesk was the second best-performing stock on the S&P 500, rising 209%. Bartz recently dropped by FORTUNE to chat with David Kirkpatrick.

How do you explain your longevity as CEO?

I've turned this company around three times. It's like a sailboat. The weather changed, and I had to change. The economy changed, the technology changed, and luckily I had a patient board.

Autodesk started out making software for designers and architects. Where are your customers coming from these days?

About 35% of them are in manufacturing. Look around here [gestures around office]--these handles are manufactured, these cups are manufactured. This paper--that's manufactured. Another 30% is building and construction, 20% is infrastructure like roads and bridges, and 15% is media, like games and special effects. Our media division has software that layers the blood on Tom Cruise in The Last Samurai. Our customers have won the last nine Academy Awards for special effects--Master and Commander, Titanic, Lord of the Rings--you name it.

Lots of tech executives are wringing their hands about U.S. competitiveness, especially because of declining interest in math and engineering. Are you?

Oh, I'm terrified. I'm really terrified for our girls. I have a 16-year-old who likes dance and singing. But what I say to her is, "You have to be able to pass freshman college calculus, end of story." Girls are steered to liberal arts. And that decision was made for them in fifth grade.

Is that because of sexism in fifth grade or ...

Yes, yes, and yes. I get letters from freshman girls in college who tell me their engineering professors say, "It's my job to get you out of this course. Engineers aren't supposed to look like you."

Do you think outsourcing hurts the U.S. economy?

Of course not. One of my favorite examples is a little company in Tennessee. They designed a pellet stove using our 3-D software but couldn't find a local foundry that would make it for the right price. So they went online and found a manufacturer in China. Never went there: streamed the drawings with our software over the Internet; got the stoves manufactured and shipped in. Now sales are $2 million a year. Lou Dobbs and I got into a screamer on this--but we now have an eight-person company with a $2 million run rate that wouldn't otherwise exist. Why is that bad for the American economy?

You recently went to India. Any impressions?

I'm starstruck by it. There will come a time when it will be harder and harder to do business in China because they will want to do everything themselves. But India, with its federal system and a style that we better understand, and of course its huge population, will be a nice way to counterbalance the strength of China.

Why is there still so much pessimism about tech?

Five years after 2000, people either believe that it's going to come back or else have gone totally into a black mindset that says it never will and woe is us. The Indians are optimistic. The Chinese are optimistic. Even the Japanese are getting optimistic. And we're down in the mud. That is nonsense. The world is a cycle. You just don't know amplitude and frequency. So the folks that say it will never be again--I guarantee they are wrong. It's as simple as that.