Just when it looked like the recent sell-off in growth stocks couldn't get any worse, it did. Leave it to the stock market to always surprise investors -- both on the upside and the downside.

Shares of growth stocks were slammed again this week as the tech-heavy Nasdaq Composite slid 2% on Wednesday and is down more than 1.2% as of this writing on Thursday. Many growth stocks slid 5 percentage points or more on Wednesday, with steep declines persisting today. This added to a big pullback for these stocks since mid-February. Investors have been doing some profit-taking on growth stocks following their significant outperformance last year and into the first month and a half of 2021.

But have some of these stocks fallen too far? Two growth stocks starting to look attractive after declining sharply are visual search and media platform Pinterest (PINS 1.02%) and identity management specialist Okta (OKTA 1.31%).

Here's a closer look at why these two growth stocks may be top buys for investors willing to buy and hold shares for the long haul.

A person looking at charts on a laptop.

Image source: Getty Images.

1. Pinterest

While 2020 was a big year for Pinterest, COVID-19 actually wasn't a good thing for the company's revenue. With virtually all of the revenue coming from digital advertising, Pinterest's top-line growth slowed to just 4% in the second quarter of 2020. But the company did see a lift in user engagement. Monthly active user growth accelerated during the period as revenue growth slowed. 

All of this, of course, made sense intuitively. Many advertisers pressed the pause button on their advertising campaigns amid economic uncertainty and lockdowns. Meanwhile, internet usage increased as consumers sheltered at home, benefiting apps like Pinterest.

But where Pinterest has been winning over investors is with its ability to keep growing its user base while simultaneously returning to very high revenue growth since the peak of consumer sheltering and lockdowns.

Showing how well the tech company has been executing, Pinterest wrapped up 2020 with fourth-quarter revenue growing 76% year over year to $706 million. Monthly active users were 459 million, up 37% year over year.

2. Okta

Okta's business wasn't as volatile as Pinterest's during the pandemic. Revenue growth rates stayed in the 40s throughout 2020, with the company growing total revenue in fiscal 2021 (the 12-month period ending Jan. 31, 2021) by 43% year over year. Okta's strong performance during a turbulent year highlighted the resilience of the company's enterprise-focused software-as-a-service business model. 

Notably, Okta is now generating substantial free cash flow, or cash left over after regular operations and capital investments are taken care of. Fiscal 2021 free cash flow was $111 million, or about 13% of revenue. This compares to fiscal 2020 free cash flow of $36 million, or 6% of revenue.

A person hitting a buy button on a keyboard.

Image source: Getty Images.

Why this may be a buying opportunity

Highlighting why Pinterest and Okta may be good long-term investments during this sell-off, both management teams indicate their businesses are early in their growth stories.

Consider the two companies' guidance for revenue for their current quarters. Pinterest said its first-quarter revenue will grow at a year-over-year rate in the low 70s. Okta management guided for fiscal first-quarter revenue to increase 30% to 31% year over year. And keep in mind that these companies typically provide conservative outlooks.

A recent sell-off in growth stocks gives investors a good opportunity to buy shares of high-quality companies growing rapidly. More importantly, both companies look poised to continue growing at strong rates for years to come.

Though there's no guarantee either of these stocks will pan out to be a market outperformer over the next five to 10 years, I'd venture to say that the odds of strong returns would be in investors' favor if they got in on Pinterest and Okta at these prices.