Recently, the tech sector has been challenging for investors as pandemic-era boons fade and rising interest rates increase the cost of capital while discounting the value of future growth.

With substantial 2022 declines, Amazon (AMZN 0.56%) and Nvidia (NVDA 1.25%) haven't escaped the carnage. That said, both companies have what it takes to regain their long-term growth trajectories.

1. Amazon should recover in the long run

Up 18% year to date, Amazon stock is beginning to make up for some of its crushing losses in 2022. However, there is still work to be done. While some investors might be less than impressed after weaker-than-expected fourth-quarter earnings, Amazon's challenges look temporary. And the tech giant's long-term growth thesis remains rock solid.

While Amazon's fourth-quarter earnings jumped 9% year over year to $149.2 billion, net income fell by 97% to just $300 million as high inflation and cost-cutting among Amazon Web Services clients cut into margins. That said, these results do not necessarily reflect Amazon's long-term profit potential. As a cyclical business, it is highly sensitive to temporary changes in the economy and can bounce back when conditions improve. The company still retains its industry leading scale, which creates network effects (the advantages a platform gains as more people use it).

Amazon's size also gives it a competitive advantage in digital advertising, where its large, shopping-motivated user base allows clients to better target customers. The ad business grew by 19% to $11.6 billion and will provide another source of diversification and sustainable growth.

With a forward price-to-earnings (P/E) of 57, Amazon stock is not cheap compared to near-term earnings forecasts. But investors should remember that the company is going through a down cycle and retains all the advantages it needs to recover over the long haul.

2. Nvidia's AI focus provides new catalyst

Up 59% year to date, Nvidia is bouncing back from recent declines -- although shares are still down 31% from their all-time high of $333.41, reached in late 2021. The tech giant faces slowdowns in the gaming and cryptocurrency mining markets, which make extensive use of its GPU chips. That said, pivots to new technologies such as artificial intelligence (AI) could help power the next leg of expansion.

Flaming arrow moving upwards.

Image source: Getty Images.

In a fireside chat style conversation with the Haas School of Business, University of California Berkeley, Nvidia CEO Jensen Huang stated that  AI chatbot ChatGPT is "one of the greatest things that has ever been done for computing." He said he believes it could revolutionize the tech industry by allowing people to automate difficult programming tasks and unlock productivity. From an investor's perspective, this is a huge deal for Nvidia because its industry leading GPU chips are crucial for powering this burgeoning technology.

Analysts at Omdia believe Nvidia has a staggering 80% market share in the AI processor market. And the ChatGPT platform used 10,000 Nvidia GPUs to train its model, so if this technology is as revolutionary as many expect, it will be a long-term driver of revenue growth and diversification. 

In the third quarter of fiscal 2023, ended Oct. 30, Nvidia's revenue dropped 17% to $5.93 billion on weakness in the gaming and professional visualization segments. But this was partially offset by strength in data center, which jumped 31% to $3.83 billion. With a forward price-to-earnings (P/E) multiple of 49, shares are valued significantly higher than the S&P 500's average of 22. But the premium looks fair, considering Nvidia is at the bleeding age of a potential AI revolution.

The power of strong moats 

Economic moats are hugely important when it comes to a company's staying power. While industry leading companies like Amazon and Nvidia can sometimes go through near-term challenges, their competitive advantages can help them bounce back over the long term, making both stocks look like excellent buys.