If I could pick the brains of any living entrepreneurs, I think two of the most interesting ones would be former Microsoft CEOs Bill Gates and Steve Ballmer.

Last week, I had the chance to do that indirectly by interviewing Bob Muglia, who worked directly for both of them for decades. In so doing, he revealed leadership insights that he gleaned not only from what they did well but also from what they botched.

Nevertheless, with net worths of $79 billion and $21 billion, respectively, they got a lot right during their tenures at the 40 year-old company.

Muglia spent 23 years at Microsoft--from 1988 to 2011--during which time he ran its $16 billion servers and tools business. After a stint at Juniper Networks, last June he became CEO of San Mateo, Calif.-based Snowflake Computing. In October he helped the now-65-employee cloud-based data warehousing service raise $26 million in capital.

I asked Muglia to tell me what he learned from the good and not so good things he watched them do. Here are eight leadership insights that Muglia learned from Gates and Ballmer.

Bill Gates

1. Create winning business models

This is clearly the key to Gates's net worth. Gates was able to figure out a way to divide up the profits with Intel in what was once a huge and rapidly growing market for personal computers. Microsoft did this by essentially monopolizing the PC operating system market and then using that power to encourage PC makers like Dell and Compaq to bundle Microsoft's software with their hardware--what Muglia called the OEM model.

As Muglia explained, "Gates is responsible for the OEM business model. And it is not something that other people thought about until after he had made it work."

2. Think about the long-term

Muglia found that Gates was always thinking about the long-term and how Microsoft could win. "Bill took the longer-term view. He believed that he had a better intuition about how the market would evolve and that Microsoft should supply proprietary technology to win over the long-term. He took it as senior management's responsibility to think carefully about how the future might play out," said Muglia.

3. Attack ideas analytically

Muglia was impressed by how willing Gates was to have his ideas challenged by others. "Bill liked it when people would go into his office and tell him he was wrong. He had a different view of reality than the one others saw. He wasn't always right but when he was, it was powerful."

While Gates had an idiosyncratic approach, winning ideas often targeted big, uncrowded markets in which Microsoft had unique skills. "The market had to be there, the technology has to work, and he didn't want to do something that everyone else was doing," explained Muglia.

Though Muglia did not come out and say this, I am guessing that Gates often tore into people who challenged him without having solid arguments. If they ever went back in to his office in an effort to challenge him in the future, they would have a more bullet-proof argument.

4. Hire and motivate great people

It is a basic axiom of today's startup world that the company with the best talent often wins. The best coders are way more productive than their less-talented peers and the same can be said for marketers and sales people.

But how do you convince them to join your company? "In 1995, when Microsoft was dominating the PC software market which was exploding, it was easy to hire top talent. Microsoft was changing the world. And Microsoft's great people gave off electricity that attracted more talented people. After 2000, it was harder to attract that talent," said Muglia.

5. Don't make it personal

One of the big problems at Microsoft was that intellectual attacks became personal ones. And that drove away talent and demotivated people.

Noted Muglia, "The negative side of challenging people's views was a culture of aggressiveness that got personal. Microsoft pushed it beyond the level that was appropriate. It got personally abusive."

At Snowflake, Muglia dials back the aggression. "I encourage people to challenge my thinking and if they make a compelling argument, I will change our strategy and let them know that they contributed to the change. This motivates people to think and challenge without getting too personally aggressive," he explained.

6. Don't let a core strength turn into a core rigidity

Microsoft had so much success with its OEM model, that it looked to apply the same approach to other businesses it entered after Gates saw the rise of the Internet.

In so doing, Microsoft let a core strength block it from finding effective strategies in other markets. "Bill's decision to stop working on Internet Explorer in 2001 was a mistake. He wanted to focus more on proprietary technology like the Windows Graphic Library. And he tried to apply the OEM model on Windows Phone--which was not effective," he said.

I am not sure how Muglia is applying this insight. But I think it would be particularly important for any company that achieved big success not to lose its flexibility.

Steve Ballmer

7. Get your numbers right

Ballmer was exceptionally good at math--in a page of thousands of numbers used for a business unit's sales forecasts, he could quickly spot the one that was wrong.

Explained Muglia, "Steve made us do RevSums--which were 11 by 17 inch pieces of paper with 3,500 numbers on them. He would look at it for 90 seconds and say, 'That number is wrong.' Nine times out of 10, he would be right."

8. Accept that you can learn from others

I asked Muglia to tell me how he thinks Gates and Ballmer would respond if he went to them seeking advice on a taxing business problem Snowflake is facing.

Gates would go off on wild tangents and Ballmer would blurt out the 'right' answer. "I would tell Bill that I had a problem, I was considering some options, and what did he think. Bill would start talking about ideas that I had not thought of. I would have to decide whether any of them were right. Steve would just tell me what I should do," noted Muglia.

My take is that Ballmer's sense of always knowing the right answer did not serve him well when he became CEO.