According to the U.S. Labor Department, unemployment dropped to 3.6% in April, its lowest level since February 2020. At the same time, the consumer price index rose 8.3% over the past year, marking the 14th consecutive month in which inflation has exceeded the Federal Reserve's 2% target. When viewed together, the Centre for Economic Policy Research (CEPR) says those metrics signal a recession is coming in the near future.

Since 1955, there has never been a quarter with average inflation above 5% and unemployment below 4% that was not followed by a recession in the next year, according to the CEPR. The U.S. economy actually crossed that threshold in the fourth quarter of 2021, which implies a 100% chance of a recession sometime in 2022.

Let's put that information in context.

Two investors studying price charts on several different desktop monitors.

Image source: Getty Images.

Is it time to sell?

The economy has successfully weathered 17 recessions over the last century, and the stock market has always hit new highs on the other side of those events. More importantly, the market tends to be forward-looking in nature. That means stocks often fall before a recession starts and often start rebounding before a recession ends.

Right now, the S&P 500 is down nearly 20% from its high, which means the index is flirting with bear market territory. That means a decision to sell could hurt you in two ways: You would lock in any losses in your portfolio, and you may miss out on the inevitable rebound. For that reason, downturns are generally a good time to put money into the market.

With that in mind, here are two growth stocks to buy and hold through any recession.

1. Nvidia: Graphics and artificial intelligence

Nvidia's (NVDA 0.35%) invention of the graphics processing unit (GPU) has revolutionized the entertainment industry, bringing ultra-realistic visuals to video games and films. But GPUs are also used to accelerate complex data center workloads like artificial intelligence (AI) and scientific computing. Thanks to its first-mover status, Nvidia currently holds over 90% market share in both workstation graphics and supercomputer accelerators.

To reinforce its strong market position, Nvidia has expanded its portfolio to include data center networking solutions and a variety of subscription software products. For instance, Nvidia AI Enterprises is a suite of software tools for AI application development. Nvidia even provides frameworks that accelerate specific workflows. For instance, its Clara framework helps researchers build AI-powered applications for medical imaging and genomic sequencing, and its Isaac framework helps engineers design AI-powered applications for autonomous robots and machines. Thanks to that comprehensive approach, the Nvidia brand has become synonymous with AI. In fact, the company has consistently set the bar at the MLPerf Benchmarks, a series of standardized tests meant to measure the performance of AI technologies.

Collectively, Nvidia's strong market position in the graphics and data center industries has translated into phenomenal financial results. Over the past year, revenue surged 61% to $26.9 billion, and free cash flow skyrocketed 73% to $8.1 billion. And shareholders have good reason to believe that momentum will continue.

Technologies like 3D graphics and AI will only become more relevant as trends like virtual reality, the metaverse, autonomous robots, and self-driving cars reshape the world. That should be a tailwind for Nvidia. In fact, management puts its market opportunity at a whopping $1 trillion. That's why this growth stock is worth buying, even if we see a recession in the next year.

2. The Trade Desk: Digital advertising

The Trade Desk (TTD -2.47%) specializes in AI-powered digital advertising. Its software helps marketers plan, measure, and optimize data-driven campaigns across connected TV (CTV), desktop, and mobile devices. Better yet, its platform is built on bid factor technology, which allows marketers to set expressive targeting parameters more easily than the line-item-based architecture used by other buy-side platforms.

In turn, The Trade Desk has become the leading independent ad tech platform for ad buyers, and that scale serves to reinforce its strong market position. Each ad campaign powered by its platform generates more consumer data, and every data point makes its AI models a little smarter. In other words, compared to smaller rivals, The Trade Desk's scale theoretically means its AI models are better at driving clicks and conversions for advertisers.

Thanks to that value proposition, The Trade Desk has kept its customer retention rate over 95% for eight consecutive years. More importantly, the company has continuously gained market share in the digital ad industry, posting strong financial results in the process. Revenue rose 44% to $1.3 billion in the past year, and free cash flow climbed 12% to $394 million.

However, The Trade Desk still has plenty of room to grow its business. Global digital ad spend is expected to reach $785 billion by 2025, according to eMarketer. More importantly, management is executing on a strong growth strategy that should lead to continued market share gains. For instance, the company launched Solimar last year, the latest version of its ad tech platform. Solimar incorporates a better AI engine and the "the world's most advanced data marketplace," both of which help marketers measure and optimize campaign performance more effectively. That's why it makes sense to buy and hold this growth stock through any recession.