When the next prolonged bull market will really take off is anyone's guess. One of the few predictable things about the stock market is that it is unpredictable. However, so far, the U.S. market has a 100% track record of recovering from bear periods and eventually reaching new highs. 

When you stay invested in the stock market through its highs and lows, while you will inevitably experience the pain of some tough days, you'll also be positioned to benefit from its best days. And while many stocks are still trading down from their all-time highs, a string of robust market days in 2023 has given serious bumps to a number of great companies.

Here are two such stocks with underlying businesses that can generate enviable returns for patient investors over the long run. 

1. Pinterest

Pinterest (PINS 21.02%) is contending with a difficult ad spending environment right now, and it will be a while before the economic conditions that led to it recede. However, the social media platform is continuing to not only draw more users, but to monetize them well, which creates a solid picture for its long-term growth. 

Pinterest's platform revolves around a virtually endless array of "pins" in the form of images and short videos that not only provide inspiration to users but help them find items and services they want to purchase. Today, roughly 50% of all Pinterest users look at the platform as a place to shop. These user behaviors drove a 40% year-over-year surge in shopping ad revenue in the first quarter.  

The company is leaning into this. Management said on the first-quarter earnings call that the eventual goal is to make every single pin on the platform a shoppable one. Pinterest also announced its first third-party ad partnership, with none other than the e-commerce titan Amazon. CEO Bill Ready explained how this will help the company achieve its long-term monetization goals.  

 ... [W]hen we look at Amazon as a first partner, they bring great breadth on brands and products paired with a really great consumer buying experience that we think can aid progress on shoppability in our platform ... Our early indicators of success on shopping, we could not feel better about as we have brought more shoppable content into our core services. We've seen 30%-plus increases in engagement on shoppable pins and 30%-plus year-on-year increase in attributed checkouts for merchants who are uploading their catalogs to us.

Worldwide, Pinterest had about 463 million monthly active users as of the end of Q1. That figure was up 7% from a year prior, but 26% from three years ago. Growth has slowed from its rates during the first couple of years of the pandemic, which isn't surprising given the fact that consumers aren't stuck at home anymore, and ad spending overall is down.

Pinterest also has work to do to get back to consistent profitability, although its recent workforce reductions should help to increase operational efficiency over the long run. For patient investors, though, the company's steady strides in user growth and monetization even in this constrained ad environment may prove too enticing to pass up given its current valuation, a mere 5.7 on a price-to-sales basis.

2. Upstart 

Upstart (UPST 3.34%) has been heavily short-squeezed in recent months, and those squeezes have contributed to the stock's roughly 160% run-up since the start of this year. However, other factors that are moving the needle for this fintech stock deserve a second look from risk-tolerant long-term investors.

Currently, the company trades at a price-to-sales ratio of about 4.  

Now, there's no debating that it's been a tough time for this business. The lending industry is in flux due to higher interest rates than the U.S. has seen in years, and the increased risk of borrower defaults that this creates.

Upstart's balance sheet has plunged into unprofitability, and its revenue declined substantially as lending volume has dropped. Consumers have been more hesitant to apply for loans, and institutional investors have been less inclined to fund them. 

In response, Upstart took aggressive measures, laying off roughly 20% of its workforce and pausing work on its small business loan products. On the flip side, the company continued to focus on its core personal loan and auto loan businesses, all while improving platform automation and growing its base of lending partners. And it has taken steps to resolve its funding issues. 

The company recently announced multiple funding deals, including a purchase agreement worth up to $4 billion with alternative investment firm Castlelake. Upstart launched 23 new artificial intelligence models and completed its largest platform accuracy upgrade in the first quarter of 2023. At the time of its earnings report, it had 99 lending partners, compared to 50 a year earlier.  

Not only are 84% of all Upstart's loans now being completed by fully automated processes, and so are 90% of its small-dollar loans.

Consumers can apply for loans through Upstart's platform at any time of day, any day of the week, and 70% of applicants do so from mobile devices. Not only does this create an unparalleled ease of accessibility to lending products, but Upstart's approval and denial process relies upon its AI-powered platform, which examines more than 1,000 data points to assess a person's creditworthiness and risk of default.

Upstart can wield this competitive advantage as the lending industry recovers. Investors may want to take a second look at the stock, as it could easily surge higher in the coming months.