Inflation hit a four-decade high over the summer, interest rates are rising faster than they have since the 1980s, and some economists see a recession in the future. Those worries sent the stock market tumbling in 2022. In fact, the broad-based S&P 500, the tech-heavy Nasdaq Composite, and the small-cap-focused Russell 2000 have each declined for three consecutive quarters. That hasn't happened since 2009.

For some, that news is a reason to stay away from the markets. But for other investors, it presents a once-in-a-decade opportunity. Let's look at two growth stocks to buy before the year ends that can help long-term investors take advantage of this opportunity.

1. Cloudflare: Blazing speed and ironclad security

Cloudflare (NET -1.47%) operates a global edge cloud platform. It provides application, networking, and security services that accelerate and protect business-critical software and infrastructure across on-premise, cloud, and hybrid environments. Cloudflare also provides developer tools that help businesses create performant applications and websites.

Cloudflare is built for speed. It has servers in 275 cities around the world, and its platform interconnects with every major internet service provider, cloud vendor, and enterprise. That architectural advantage allows Cloudflare to reach 95% of internet users within 50 milliseconds. In fact, Cloudflare is the fastest provider in 43% of networks worldwide, and it's the market leader in content delivery network software.

The company also achieved a strong position in other areas. Last year, Forrester Research ranked Cloudflare as the market leader in edge development platforms, and research company Gartner recently recognized its leadership in web application and API (application programming interface) protection.

Cloudflare continued to achieve rapid growth in the most recent quarter, in spite of economic uncertainty. Its customer count increased by 18% over the past year, and the average customer spent 24% more during that time period. In turn, third-quarter revenue jumped 47% to $254 million, and the company generate non-GAAP earnings of $0.06 per diluted share, up from breakeven in the same period last year.

Going forward, investors have good reason to think that momentum will continue. Cloudflare puts its addressable market at $135 billion in 2024, and its capacity for innovation should be a persistent tailwind.

For instance, Cloudflare has built a robust suite of zero-trust security services, including recently launched products for email security and threat intelligence. But its most noteworthy offering is Cloudflare One, a secure access service edge (SASE). That product blends cloud networking and security services to make corporate IT environments faster and safer while eliminating the need to maintain costly network hardware in private data centers. Research company Gartner says SASE adoption will quadruple between 2021 and 2025.

Currently, shares trade at 17.8 times sales, much cheaper than the three-year average of 41.6 times sales. That creates an excellent buying opportunity for patient investors.

2. DigitalOcean: Cloud computing solutions for small businesses

DigitalOcean (DOCN -0.90%) operates a cloud computing platform. It provides basic infrastructure services like compute and storage, and a growing number of platform services like managed databases and developer tools. But all of its products are engineered for small- and medium-sized businesses (SMBs), a group that often lacks the necessary IT support to work with vendors like Amazon Web Services and Microsoft Azure.

In a nutshell, DigitalOcean simplifies cloud computing with an intuitive interface, click-and-go options, and round-the-clock customer support. Those qualities make it easy for SMBs to build and deploy applications across a variety of industry verticals, from finance and commerce to media and gaming.

Financially, DigitalOcean continued to grow at a steady clip in the third quarter. Net retention hit 118%, meaning the average customer spent 18% more over the past year. In turn, quarterly revenue climbed 37% year over year to $152 million and the company posted a GAAP profit of $0.10 per diluted share, up from a loss of $0.02 per diluted share in the same period last year.

Looking ahead, investors have good reason to be optimistic. DigitalOcean estimates that SMBs will spend $145 billion on cloud computing each year by 2025, and the company is steadily growing its portfolio.

On that note, DigitalOcean recently completed its $350 million acquisition of Cloudways, a company that provides managed website hosting services to SMBs -- especially those that use WordPress, the most popular content management system on the planet. Cloudways makes it possible for SMBs to build fast and reliable websites without managing the underlying infrastructure. Now part of DigitalOcean's portfolio, those services further its ability to simplify cloud computing for SMBs.

Currently, shares trade at 6.2 times sales -- a discounted compared to the average of 12.7 times sales since DigitalOcean made its public debut in early 2021. That's why this growth stock is worth buying in the bear market.