As a child growing up in South Africa, Elon Musk was fascinated with space.

When Mark Zuckerberg was a teenager, he frequently became frustrated when a playlist would end, thinking of ways to improve upon music recommendation software.

And Bill Gates, ever the whiz kid, was drafted by a company to develop technology at 16 and sometimes worked 18-hour days.

Many famous tech CEOs have always loved the nitty-gritty development side of the industry - often creating their own video games and software and writing code from a very young age.

However, today, some tech execs are not as involved in the engineering side of the companies they head, but instead serve as the face of some of the largest companies in the world.

Here are the earliest software programs, video games, and technological endeavors by some of the today's most successful and well-known tech executives:

Before becoming the philanthropic billionaire he is today, Microsoft cofounder Bill Gates developed a course scheduling software for this high school as a teen. Not only did his school notice his gift for technology, but so did TRW, an automotive company based in Michigan. There, a 16-year-old Gates helped create and develop energy software, for often 18 hours a day.

As a teen, Gates also met Microsoft cofounder Paul Allen, where they immediately bonded over their love for technology. Allen and Gates then founded Traf-o-Data, their first company where they collected traffic data and sold it to some municipalities in Washington.

Before he became a billionaire, and one of the richest people in the world, Facebook founder Mark Zuckerberg turned down $1 million (R15 million) for a music-recommendation software, called Synapse, which he developed as a teenager.

In 2002, Synapse, similar to apps like Pandora and Spotify, caught the attention of Microsoft, which offered him $1 million (R15 million) - they even offered him a job, too. Zuckerberg told Harvard's student magazine, The Crimson, he and Synapse co-creator Adam D'Angelo "wanted to go to college, so we said no."

Ultimately, they decided to make Synapse free to use. Just one year later, Zuckerberg would launch what was then called The Facebook.

Blastar, a space-themed video game akin to the famed arcade classic Space Invaders, was designed by now Tesla CEO Elon Musk when he was 12. The game’s mission is to take down an alien fleet before it defeats you, the sole space cadet sent to fight it.

Musk is no doubt perplexed by what space has to offer - he founded Space X, an aerospace manufacturing company, when he was 30.

As a 12-year-old, Musk sold the code for Blastar for $500 (R7 500) to a magazine while he was still living in South Africa. Thanks to the internet, you can play the game here.

Former Uber CEO Travis Kalanick started an SAT-prep business called New Way Academy when he was 18.

From an early age, Travis Kalanick, Uber founder and former CEO, was intrigued by computers, and began writing code when he was in middle school. As an 18-year-old, he started an SAT-prep business called New Way Academy. Kalanick dropped out of college to begin his career as a serial entrepreneur in tech, and soon launched Scour - a file-sharing search engine.

As a student at University of California, Santa Barbara, Lyft CEO and co-founder Logan Green built the first iteration of his ride-hailing app — a car-sharing service kids on campus could use if frustrated with public transportation and traffic.

Green's partner, John Zimmer, said that "[Green] built the first car-sharing program at UC Santa Barbara, before Zipcar was there."

The car-sharing service garnered the attention of local officials, and he was the youngest person elected to Santa Barbara's transit board. Lyft would go on to be worth $29 billion (R431 billion).

When Google CEO Sundar Pichai was introduced to computers, the first software program he developed was a no-nonsense chess game. He's still an avid chess player today.

Before they cofounded Apple together, Steve Jobs and Steve Wozniak developed a video game for Atari, as teenagers, called Breakout — similar to that of Pong, where there is a paddle and ball moving at different speeds and angles.

According to Wozniak, at the time game development was not software, but hardware: "I designed Breakout with only 45 chips [...] Atari was getting tired of their engineers designing games with 150 chips, 190 chips."

Atari then paid Jobs for the work Wozniak did, but Wozniak said he didn't mind because at the time he was an engineer at Hewlett-Packard. Jobs soon convinced him to leave HP to start Apple. And the rest is history.

At age 15, 10 years before he became a millionaire, Salesforce founder Marc Benioff sold his software application entitled “How to Juggle” for $75 (R1,100) and founded his own business, Liberty Software.

Benioff sold games to Atari as a teenager - games like Crypt of the Undead, King Arthur's Heir, The Nightmare and Escape From Vulcan's Isle, according to Entrepreneur.

By the time he turned 16, he was making nearly $1 500 a month, roughly $4 660 (R66 500) in today's dollars. And though he planned to stay on the programming side of tech throughout his career, he eventually leaned into the business side after founding Salesforce in 1999. Today, Benioff has a net worth of $6.5 billion (R967 billion).

When he was 15, Twitter cofounder and CEO Jack Dorsey wrote code and developed programming for taxi dispatching.

As Dorsey's interest in dispatching software grew, he decided to create a start-up in Oakland, California, to perfect how cab drivers continually remain in contact, code which is still used today. The program was also used to dispatch emergency vehicles.

According to The Verge, Dorsey used an Apple Macintosh computer while developing the software. A few years later, in 2006, Dorsey would send out the world's first ever tweet.