Shares of PubMatic (PUBM 1.75%) and DigitalOcean (DOCN 3.30%) tumbled after each company reported its own disappointing quarterly results. PubMatic is struggling with a tough digital advertising market and the impact of a one-off industry bankruptcy, while DigitalOcean is seeing its customers grow increasingly cautious with spending.

While both companies are facing significant headwinds, long-term investors would be wise to consider picking up shares at beaten-down prices.

PubMatic

Shares of digital advertising technology company PubMatic took a beating on Wednesday following a quarterly report that wasn't well-received. By late morning, the stock was down about 27%.

While PubMatic beat analyst estimates for both revenue and earnings in the second quarter, the company's guidance seems to have spooked the market. PubMatic reported revenue of $63.3 million and an adjusted net loss of $0.02 per share, both well above analyst expectations. For the third quarter, the company expects revenue to slump to a range of $58 million to $61 million.

Headwinds include pricing challenges and the impact of the bankruptcy of demand-side platform MediaMath. PubMatic is reportedly owed $10.5 million by MediaMath. The company took a $5.7 million bad-debt expense in the second quarter related to the bankruptcy, which hurt GAAP earnings.

While PubMatic is muddling through a tough environment, the company continues to generate plenty of free cash flow. PubMatic owns and operates its own infrastructure, so it can scale down investments when business slows to preserve cash. The plan is to cut capital spending by about 70% this year. In the second quarter, PubMatic generated $10.8 million in free cash flow.

PubMatic's balance sheet is already strong, and maintaining positive free cash flow will keep it that way. The company had cash and investments of $171 million at the end of the second quarter, with no debt. It will be able to weather this storm without issue.

The company's market capitalization had fallen to about $710 million by late Wednesday morning. While the stock may not look cheap based on current earnings, PubMatic's long-term growth opportunity hasn't changed. The company sees an opportunity to more than quadruple its market share in the long run.

While the short-term picture doesn't look great for PubMatic, the big post-earnings decline in the stock price is a good opportunity to pick up shares.

DigitalOcean

Shares of cloud computing provider DigitalOcean tumbled after the company reported decent second-quarter results but warned of a major slowdown. Customers are hesitant to increase spending and are looking for ways to reduce spending where possible. This situation isn't unique to DigitalOcean, with every major cloud computing provider facing at least some headwinds.

DigitalOcean now expects revenue to grow by just 18% this year to a range of $680 million to $685 million, compared to 34% growth in 2022. The good news is that free cash flow should remain soundly positive.

The company has an efficient customer acquisition model centered around providing helpful content across a variety of websites. It spent less than 10% of revenue on sales and marketing in the second quarter. While DigitalOcean isn't quite consistently profitable on a GAAP basis, free cash flow is a different story.

Through the first six months of this year, DigitalOcean generated free cash flow of $50.6 million and expects to convert between 21% and 22% of revenue into free cash flow this year. That percentage would be higher, but the recent acquisition of artificial intelligence (AI) cloud platform Paperspace requires significant capital investment.

DigitalOcean's ability to churn out free cash flow, even as growth slows, is impressive. While growth will be sluggish for now, the company's long-term growth opportunity is enormous. DigitalOcean estimates that individuals and companies with fewer than 500 employees will spend $195 billion on cloud infrastructure by 2026. The company has only begun to tap into its core market.

This year is going to be tough for DigitalOcean. However, for investors willing to stick around for the long haul, the cloud computing stock looks like a solid long-term buy.