Whether investors believe the market is headed for a mild recession or a new bull market (or don't care to hazard a guess), considering the two growth stocks in this article could prepare you for either environment.

Whereas Shopify (SHOP -2.37%) boomed in bullish markets, Ulta Beauty (ULTA -2.08%) remained as resilient as ever in more challenging times recently. However, despite arriving at their current share prices in wildly different fashions, Shopify and Ulta Beauty have more than doubled the returns of the S&P 500 Index over the last five years.

Looking to build upon this track record, these two contrasting businesses represent fantastic buy-and-hold opportunities for the long term, regardless of what turns the market may take over the next few quarters.

Let's explore what opportunities make them stand out.

Shopify is going global

Despite nearly tripling over the last five years, e-commerce enabler Shopify has seen its share price plummet more than 70% since 2021 as investors wrestled with the reality of rapidly decelerating growth.

After briefly trading for a stunning price-to-sales (P/S) ratio of 50, Shopify was seemingly doomed as it tried to lap pandemic-boosted comparables and a valuation that demanded absolute perfection. To put this P/S ratio of 50 into perspective, a company with a 10% net income margin would be trading at 500 times earnings -- and Shopify isn't consistently profitable yet. 

It's now reporting 26% sales growth year over year in the fourth quarter of 2022. It is clear that the company's days of triple-digit growth rates are a distant memory.

Chart showing Shopify's revenue growth falling since 2021.

SHOP Revenue (Quarterly YoY Growth) data by YCharts

However, this 26% revenue growth would be considered exceptional for most companies not named Shopify. Better yet, this growth looks sustainable considering one significant tailwind supporting Shopify's operations -- cross-border sales growth.

With Grand View Research projecting global cross-border sales to grow by 26% annually through 2030, Shopify's international-facing Markets offering looks poised to thrive. Partnering with direct-to-consumer cross-border enabler Global-e Online, Shopify has built an end-to-end international commerce offering that allows merchants from 175 countries to sell anywhere. 

These cross-border sales account for 14% of the company's gross merchandise volume (GMV), but this number should continue expanding steadily. Moreover, with 28% of its merchants' traffic coming from outside their home countries, these foreign sales represent a promising growth opportunity for customers only selling domestically. 

Highlighting the value its merchants see from Shopify's foreign sales offerings, its Markets Pro customers saw their cross-border conversion rates rise by 36% in 2022. By solving the complexities of local tax compliance, currencies, languages, shipping options, payment options, pricing, and markets, the company's merchants can now go from first sale to full scale globally.

While Shopify still trades at a hefty 10 times sales, this valuation is less than half the company's publicly traded average of 24. Furthermore, Shopify's growing 10% market share of U.S. e-commerce GMV and remaining international growth runway make it an excellent stock to add to in uncertain times, as it should only become more dominant over the next few decades. 

Ulta Beauty: A market leader loved by Gen Z

Ulta Beauty is the largest beauty retailer in the U.S., home to over 1,300 stores and 350 shops inside Target (NYSE: TGT) locations. Rising more than 1,600% since its 2007 initial public offering (IPO), Ulta's stock continued its tear in recent years despite facing a pandemic in 2020 and a slowdown in consumer spending recently.

This incredible performance helps highlight Ulta's resilience and shows beauty sales' sticky nature over time. By generating the bulk of its sales from cosmetics, haircare, skincare, fragrances, and bath products, Ulta may benefit from an unusual economic indicator known as the Lipstick Effect.

This effect shows that customers will opt for more small luxuries (like Ulta's lipstick or perfume) in challenging economic times, rather than big-ticket indulgences such as a vacation or a vehicle. This indicator may help explain Ulta's recent strength as its stock continues to hit all-time highs over the last two years despite ballooning credit card balances and the potential of a recession looming. It grew sales and earnings per share by 18% and 24% in fourth-quarter 2022, so despite this environment, the company looks as strong as ever.

Even better for investors, regardless of where the broader economy may go, the company's products are beloved by Gen Z (18- to 25-year-olds), who give it a Net Promoter Score (NPS) of around 50. NPS is scored on a scale of -100 to 100 and measures whether or not a customer would recommend a company's product to a friend, making Ulta's score of 50 among its youngest customers exceptional.

The company is home to an incredibly loyal customer base that drives steady recurring sales. It generates 95% of its sales from its over 40 million Ultamate rewards members.

With a high and rising average return on invested capital (ROIC) of 32% over the last decade, Ulta looks like a strong candidate to continue outperforming over the long term.

Chart showing Ulta Beauty's return on invested capital falling in 2020-2021 and then rebounding.

ULTA Return on Invested Capital data by YCharts

ROIC measures a stock's profitability compared to its debt and equity, with higher-ranked ones historically beating their peers. With Ulta's ROIC ranking in fourth place among its 59 peers in the S&P 500's consumer cyclical sector, it is a prime candidate to outperform according to this metric.

Furthermore, its price-to-earnings (P/E) ratio of around 22 remains well below its average mark of 34 times earnings across the last 10 years. This combination of reasonable valuation, impressive profitability, and loyalty among its youngest customers makes Ulta Beauty a terrific growth stock to buy and hold forever.