The Nasdaq Composite nosedived into a bear market last year, dragged down by high inflation, rising interest rates, and recession fears. Throughout that drawdown, Tesla (TSLA -2.57%) and Microsoft (MSFT -0.69%) have seen their share prices plunge 73% and 30%, respectively. To put those losses in context, neither stock has suffered a sharper decline at any point in the past decade.

On the bright side, economic challenges are temporary, and both businesses remain well positioned for growth over the long term. For that reason, investors should view the current situation as a once-in-a-decade buying opportunity.

1. Tesla is still a leader in innovative vehicle technologies

Last year was tough for Tesla. Between supply chain disruptions, temporary closures of Gigafactory Shanghai, and softening consumer demand, the company missed Wall Street's delivery estimates in the third and fourth quarters. Tesla also missed its own forecast of 50% average annual growth "over a multi-year horizon," as deliveries grew just 40% to 1.3 million in 2022.

Fortunately, those headwinds are temporary. Supply chain problems will resolve in time; China has shifted away from its zero COVID-19 policy; and consumer spending should rebound as inflation normalizes and interest rates fall. That means the long-term investment thesis is still intact. In other words, Tesla is well positioned to benefit from the secular shift toward autonomous vehicles and electric cars -- better than any other automaker in the near and long term, according to Baird analyst Ben Kallo.

Tesla has yet to report Q4 financial results, but its Q3 report was solid. Revenue climbed 56% to $21.5 billion; Tesla achieved an industry-leading operating margin of 17%; and free cash flow soared 148% to $3.3 billion.

Looking ahead, management says full self-driving (FSD) technology will eventually be the most important source of profitability. Tesla recently made its FSD beta software available to all North American customers, which should push operating margins even higher over time. The company also plans to achieve volume production of a robotaxi in 2024, which will move Tesla one step closer to its endgame: an autonomous ride-hailing platform.

Building on that, Tesla has logged data from more autonomous driving miles than any other automaker, and data is essential for training the artificial intelligence (AI) models that power self-driving cars. That advantage positions Tesla to be a leader in autonomous vehicles, a market Precedence Research says will grow at 39% annually to reach $1.8 trillion by 2030. Meanwhile, Transparency Market Research says the broader electric vehicle market will grow at 30% annually to reach $1.9 trillion by 2031.

In a nutshell, Tesla is set to benefit from two large and growing opportunities, which make its valuation of 5.1 times sales look relatively reasonable. Of course, that multiple is quite pricey compared to other automakers, but it is cheaper than Tesla's three-year average of 15.7 times sales. That's why risk-tolerant investors should buy a small position in this growth stock today.

2. Microsoft has several big opportunities ahead of it

Microsoft technology can be found at the core of most organizations. For instance, Microsoft 365 is the most popular enterprise application suite, and the Windows operating system is the gold standard for personal computers and data center servers. Microsoft has also carved out a strong market presence in areas like communications, business intelligence, and enterprise resource-planning software. Those tools will keep the company relevant for many years to come.

Not surprisingly, Microsoft's growth has slowed amid the difficult economic environment. In the most recent quarter, revenue increased just 11% to $50.1 billion, while earnings dropped 13% to $2.35 per diluted share. But growth should reaccelerate when the economy rebounds, and Microsoft has several exciting growth opportunities.

The first is cloud computing. Microsoft Azure accounted for 21% of cloud-infrastructure and platform-services spend in Q3, making it the second most popular cloud vendor. In fact, Microsoft has nearly twice as much market share as third place Alphabet. That puts the company in a good spot, as cloud spending will grow at 20% annually to reach $1.7 trillion by 2029, according to Fortune Business Insights.

The second exciting growth opportunity is digital advertising. It may surprise some investors to learn that Microsoft is currently the seventh largest digital ad company in the world, but platforms like LinkedIn and Bing Search have allowed the company to develop a foothold in that market. Better yet, Microsoft provides the ad tech that powers Netflix's ad-supported streaming service. That exclusive partnership should help Microsoft tap into the online video ad market, which is expected to grow at 14% annually to reach $362 billion by 2027. Meanwhile, Statista says the broader digital ad market will grow at 10% annually to surpass $1 trillion over the same time period.

The third exciting growth opportunity is cybersecurity. Analysts recognize Microsoft as a leader across several industry verticals, including security information and event management, unified endpoint management, and access management. And those accolades have come alongside strong growth. For instance, Microsoft increased its security customer count by 33% in the most recent quarter. More than 860,000 organizations now rely on its cybersecurity software. That puts Microsoft in a good spot. The cybersecurity market is expected to grow at 12% annually to surpass $500 billion by 2030, according to Grand View Research.

With that in mind, shares of Microsoft currently trade at 25 times earnings. That is not cheap in a traditional sense, but it is reasonable in the context of Microsoft's growth opportunities, and it is a discount compared to the three-year average of 32.1 times earnings. That's why this stock is worth buying today.