A recession is defined as two consecutive quarters of slowing economic growth, measured by gross domestic product (GDP) data. Over the last two years, interest rates have been at record lows while the U.S. government injected trillions of stimulus dollars into the economy to fight the pandemic, which led to strong growth. 

Now, the Federal Reserve is raising interest rates back to normal levels, which could slow down the economy, and if it goes too far, it might even lead to a recession. Wall Street investment banks think the likelihood of that outcome within the next 12 months is around 30% to 40%.

But that might be too pessimistic

The stock market is paying close attention to that risk. The technology sector in particular, which is represented by the Nasdaq-100 index, has fallen 28% in 2022 so far, placing it firmly in a bear market. But are investors being too negative?

According to the most recent data, there are approximately 11.4 million job openings across the U.S. right now, but only 6 million people who are unemployed. It implies that businesses are feeling optimistic enough to hire more staff, and since there isn't enough available labor to fill all those jobs, employees might see their income continue to rise.

On that note, households are in great financial shape; their net worth (assets minus liabilities) is near all-time highs, and they have the highest cash balances on record. These conditions typically don't signal a looming recession, so what should investors do if one never comes?

Here are two great stocks investors will want to own if the U.S. economy remains strong and avoids the dreaded R-word.

1. Apple

Apple (AAPL 0.51%) is a quintessential consumer brand. If the economy remains strong and consumers feel confident about their financial future, it can be expected that Apple will sell more of its big-ticket devices like the iPhone and accessories, or its Mac line of computers.

And the company now offers far more than its innovative hardware products; it's a leading name in entertainment, attracting customer dollars for its Apple Music platform and its Apple TV+ streaming service.

These brands fall under its services segment along with Apple Pay, Apple News, and iCloud, among others. It accounted for 20% of Apple's total $97.2 billion in revenue during the recent second quarter of fiscal 2022 (ended March 26). But the story is the growth rate: Services revenue increased 17% year over year compared to 7% for Apple's products segment.

It has been a common theme in recent years, partly because devices like the iPhone are used by over 1.2 billion consumers, so it gradually becomes more difficult to generate user growth. But it's not necessarily a bad thing because the services segment is far more profitable, with a gross margin that hovers above 70% compared to around 35% for products. 

By the end of the full fiscal year 2022, analysts expect Apple will have generated $393 billion in total revenue and $6.14 in earnings per share, which is equivalent to approximately $100 billion in net income. Given that Apple stock is currently down 24% from its all-time high, now might be an opportune time to take a position in the largest company in the world. 

2. Upstart Holdings

Upstart Holdings (UPST 0.96%) listed on the public markets in December 2020 at $20 per share. It has since rocketed to an all-time high of $401, before falling back down to about $32, where it trades today. The company uses artificial intelligence to originate loans for 57 banks and credit unions (a number that's growing quickly), in a bid to compete with Fair Isaac's decades-old FICO credit scoring system.

Investors have sold Upstart stock heavily in recent months because rising interest rates typically result in consumers borrowing less money, less frequently. Since the company earns fees each time it originates a loan, that could deliver a hit to its revenue, and it has already revised its 2022 guidance down to $1.25 billion from $1.4 billion.

But if the economy does remain strong, Upstart is very well positioned to benefit. The company's Upstart Auto Retail sales and finance platform is now active in 525 car dealerships across America, a number that has grown 224% in the last 12 months alone. That places Upstart on the front lines when it comes to one of the largest purchases consumers typically make.

And the company's primary focus is unsecured lending for a range of purposes including home renovations and vacations, which are more segments of higher discretionary spending when consumers are feeling confident.

In the long run, Upstart's annual opportunity could exceed $6 trillion. So, picking up the stock while it's down over 90% from its all-time high might be a good purchase when looking back a few years from now.