It’s lonely at the top, but not that lonely: well over 12,000 LinkedIn members share the title of “CEO” at companies with over 50 employees. So if you’ve ever fantasized about leading the C-suite, take note: we’re breaking down the most common routes CEOs took to the top.

Using insights from the LinkedIn platform, we looked at 12,000 CEOs from 20 countries to see where and what they studied, explore their earliest jobs on record, and uncover what positions they held immediately before making the leap to CEO.

Whether you’re recruiting executives or you’re an aspiring CEO yourself, these insights can help you spot C-suite talent early on and inform your decisions.

One important caveat before we dive in: while past career paths can be instructive, they’re not necessarily predictive of the future—so don’t count candidates (or yourself) out for lacking the credentials as the execs below. Today’s CEOs aren’t a super diverse bunch: fewer than 5% of Fortune 500 CEOs are women, and only three Fortune 500 CEOs are black. As diversity and inclusion becomes a higher priority for companies, tomorrow’s leaders will surely come from more diverse backgrounds—and make their own path.

Computer science was the most popular field of study for CEOs

Among the CEOs in our sample (see the methodology at the end for a full definition), computer science was the most popular field of study listed on their LinkedIn profile—by a pretty wide margin. The reason this STEM field came out ahead of other degrees may signal the explosion of successful tech companies over the last couple decades.

More traditionally business- or management-oriented degrees followed computer science with economics as the second-most popular, business as the third, banking/finance fourth, and electrical engineering fifth.

Stanford University was the most attended school among CEOs

Where you study may be just as important as what you study. Here are the most popular universities for CEOs, according to their LinkedIn profiles:

Note that this list includes post-graduate degrees as well as undergraduate education. That said, just 33% of the CEOs we examined have a Master’s degree or MBA.

Consultant was the most common first job (on record) for CEOs

All CEOs started somewhere—and the most common starting place for these CEOs was a consulting job. Software engineer was the next most-common, followed by analyst.

Seeing consultants at the top of the list makes sense: tackling complex challenges across multiple businesses and work environments is an ideal practice ground for the problem-solving skills CEOs need to use every day.

Note that these positions and functions reflect the CEOs’ earliest job on their LinkedIn profile—not necessarily their first job ever (our data probably misses out on lots of lemonade stands.) Members may also only list their most significant jobs, choosing to leave off internships or junior positions.

If we check out the functions of CEOs’ first jobs, a different picture emerges. Business development is far and away the most common first job function. It’s about twice as common as sales, the second-most common function, which is followed quickly by engineering.

Business development jobs require a strong mix of sales, strategy, and communication skills—all crucial to the role of CEO.

Most CEOs were directors (for a while) before being promoted to the top job

Most chief execs don’t instantly vault to the top, of course. Seventy-two percent of CEOs we looked at held a director-level role or higher immediately before they became a CEO for the first time.

Just as importantly, they held that high-level role for an average of six years—a sure sign of reliability, stability, and competence.

But perhaps most surprisingly, when we looked at CEOs of the biggest companies—ones with at least 1,000 employees—only 20% listed themselves as being promoted internally.

That means a full 80% of enterprise CEOs were brought in from an external company, per their LinkedIn profiles.

There’s no single path to becoming a CEO

There’s no one single way to become a CEO—but it doesn't hurt to study at an elite school, start out in challenging roles like consulting or biz dev, and maintain a high-level position for years. Easy peasy.

Sarcasm aside, if you’re recruiting executive talent (or talent that could one day rise to the C-suite), the indicators above can help you identify high-potential candidates. But at the end of the day, it’s not pedigree that’s the best predictor for CEO potential.

The most important commonality across CEOs isn’t really any particular school or role—it’s the ability to handle complex problems, inspire others, and prove themselves at every stage of their career path.

Methodology:

The data in this analysis was originally pulled in April 2017 and is based on information inputted by LinkedIn members. The dataset includes over 12,000 CEOs who are actively engaged members on LinkedIn, at companies with over 50 employees, and based in the following countries: USA, Japan, Singapore, South Korea, Mexico, Argentina, Chile, Belgium, Netherlands, UK, Spain, Italy, France, Germany, Switzerland, Australia, Sweden, Norway, Finland, and Denmark. This is not an exhaustive sample and does not represent all CEOs globally.

*Image of Mary Barra, Chief Executive Officer at General Motor, from Fortune Conferences

Learn how you can find and hire the right talent using LinkedIn Talent Solutions. Request a free product demo.