History has shown that the best way to accumulate wealth is to buy high-quality stocks and hold them for decades, but how does one go about deciding what stocks to include? Investors can look for companies that excel at innovation, have a stunning track record of growth, or are capitalizing on one of the latest megatrends. In some very rare cases, you can find all three.

To identify stocks that are tapping into the latest technological growth engine, we asked three Fool.com contributors to choose stocks that could still be worthwhile investments in the decades to come. Read on to find out why they chose Amazon (NASDAQ:AMZN), Microsoft (NASDAQ:MSFT), and Alphabet (NASDAQ:GOOGL), (NASDAQ:GOOG).

A number of antiques, including an hour glass, a compass, and a pocket watch set atop an old wooden box.

Image source: Getty Images.

The e-commerce giant with a growing opportunity

Chris Neiger (Amazon): It's easy to think that Amazon's massive online retail presence is what makes this company's stock worth buying and holding for decades -- and it certainly helps -- but I think the company's massive opportunity in cloud computing makes it an even more compelling long-term investment. 

Amazon Web Services (AWS) holds a dominant position in the cloud computing market right now with about 33% market share. That's far ahead of the company's biggest rival, Microsoft, which has just 13%. Why does AWS matter so much for Amazon's long-term potential? Because the company now earns about 11% of its total revenue from AWS -- a total of $6.1 billion in the most recent quarter -- and it's a profitable business to boot.

Consider that Amazon's North American e-commerce sales were $32.1 billion in the quarter, with just $1.83 billion in operating income. Meanwhile, Amazon earned $1.64 billion in operating income from only $6.1 billion in AWS sales. AWS was also the fastest-growing revenue segment for the company in the most recent quarter, up 49% from the year-ago quarter.

Cloud computing icons over a blurred background of servers.

Image source: Getty Images.

Not only is AWS a profit-generator that's growing quickly, but the cloud-computing market is nowhere near finished expanding, either. Gartner says the public cloud was worth $260 billion last year and will climb to $411 billion just two years from now.

I think Amazon's first-mover advantage in the cloud computing space, its current dominance, and the profitability AWS brings to the company makes the company's stock a very compelling one to buy and hold for decades to come.

The mobile-first, cloud-first company

Leo Sun (Microsoft): Microsoft was once considered an also-ran that missed the crucial shift toward mobile devices and cloud services. However, CEO Satya Nadella, who took the top job in 2014, has steered the company in the right direction.

Nadella's Microsoft invested heavily in the development of key cloud services like Office 365, Dynamics CRM, and Azure. It abandoned the idea of selling mobile devices or a mobile OS and opted to launch iOS and Android versions of its ecosystem apps. It even gave out free Windows 10 upgrades for over a year in a bid to reduce the fragmentation of Windows operating systems. To spur the development of more exciting PCs, Microsoft launched new Surface devices and developed exciting new hardware like HoloLens.

Those moves were costly, but they paid off. Microsoft's revenue rose 14% to $110.4 billion in fiscal 2018, and its non-GAAP earnings climbed 18%. Its commercial cloud revenues rose 53% annually to $6.9 billion during the fourth quarter and accounted for 23% of Microsoft's top line.

Microsoft cloud head Scott Guthrie talks about Azure Cloud.

Image source: Microsoft.

Wall Street expects Microsoft's revenue and earnings to rise 11% and 10%, respectively, this year. But looking further ahead, Microsoft can keep leveraging the strength of its PC operating systems and productivity software to expand its cloud and mobile ecosystems.

When Nadella first took over, he proclaimed that Microsoft would evolve into a "mobile-first, cloud-first" company. It's gradually happening, and investors who stick with Microsoft over the next few decades could reap some impressive rewards.

So much more than search

Danny Vena (Alphabet): It wasn't terribly long ago that Google was thought to have missed the cloud revolution. Amazon was the undisputed leader, and Microsoft has mounted a significant challenge, but Google's late entry into the space left the company at a decided disadvantage, and far behind the two leaders.

But that all changed in recent months. Earlier this year, Alphabet CEO Sundar Pichai finally provided some context to Google Cloud and G-Suite productivity software when he revealed that it was "already a $1 billion-per-quarter business." He also said that based on publicly reported information, the company "is the fastest growing major public cloud provider in the world."

As if to emphasize its arrival, Google Cloud joined AWS and Microsoft Azure in the leader quadrant of Gartner's much touted 2018 Magic Quadrant for Cloud Infrastructure as a Service (IaaS) -- the only three companies to enjoy that distinction. 

What turned it around for Google Cloud? One of the contributing factors is the company's industry-leading artificial intelligence technology, which is not only challenging Amazon in the cloud, but is also making headway in the AI-based smart speaker market. Just one year after its launch, Google Home quickly gained 31% market share of the devices, despite Amazon enjoying a three-year head start.

Waymo Jaguar iPace crossing intersection

Image source: Waymo.

Alphabet has another AI card up its sleeve that could soon be a huge contributor to its revenue. The company's Waymo subsidiary is the leader in the fast-growing autonomous driving industry, and it's bulking up its fleet size in preparation for the debut of its self-driving ride-hailing service later this year. Some analysts suggest that the business could be worth as much as $140 billion.

These moves are all paying off as Alphabet reported revenue of $32.6 billion, up 25.6% in its most recent quarter, and delivered adjusted earnings per share that grew 32% compared to the prior-year quarter. Both numbers handily exceeded analysts' expectations.

With its flagship search minting money, its cloud business taking off, and its self-driving car service waiting in the wings, I think Google is poised to succeed for decades to come.

John Mackey, CEO of Whole Foods Market, an Amazon subsidiary, is a member of The Motley Fool's board of directors. Suzanne Frey, an executive at Alphabet, is a member of The Motley Fool's board of directors. Teresa Kersten is an employee of LinkedIn and is a member of The Motley Fool's board of directors. LinkedIn is owned by Microsoft. Chris Neiger has no position in any of the stocks mentioned. Danny Vena owns shares of Alphabet (A shares) and Amazon. Leo Sun owns shares of Amazon. The Motley Fool owns shares of and recommends Alphabet (A and C shares) and Amazon. The Motley Fool has a disclosure policy.