Winning investments in the technology sector have been hard to come by in 2022. The S&P 500 index is down roughly 15.5% year to date, and the even more tech-heavy Nasdaq Composit index slumped 28% across the stretch. Portfolios have been hit hard, but market volatility is also creating worthwhile opportunities.

Read on to see why two Motley Fool contributors identified these companies as top tech stocks to invest in on the heels of big pullbacks. 

This tech titan has the makings of a long-term winner

Keith Noonan (Amazon): Amazon's (AMZN -1.11%) share price has fallen 45% year to date and trades down 50% from the high it reached in July 2021. While macroeconomic pressures shaping the market at large and some headwinds impacting its business have depressed the company's valuation, the tech titan has tremendous optionality and is built for long-term success.

Amazon Web Services (AWS) spearheaded and continues to lead the cloud infrastructure market, and it should continue delivering solid sales growth and high-margin revenue in conjunction with the growth of the internet at large.

The AWS unit's performance won't be completely immune to macroeconomic pressures, but the long-term outlook for the company's cloud-infrastructure services remains very promising, and strong segment operating income should help offset high costs and other pressures currently facing the e-commerce business.

In addition to inflation-related costs, Amazon's e-commerce business is facing the waning of pandemic-driven demand and tough comparisons to periods when shoppers were avoiding in-person shopping. These trends have depressed the company's valuation, but the online retail business should get back to posting stronger performance, and the market seems to be underestimating its potential as a long-term earnings generator.

Amazon is already positioned as an early leader in robotics, and there's a good chance that automation in its warehouse and delivery networks will build to a tipping point where revenue winds up growing significantly faster than operating costs. 

Strength in the e-commerce space also allowed the company to make an easy jump into digital advertising.

Amazon ranks as the third-largest player in the digital ads industry, trailing only Alphabet and Meta Platforms, and its advertising unit has been growing at an impressive clip. With the company's digital ads business growing 25% year over year to reach roughly $9.5 billion in sales in the third quarter despite some industry headwinds, it's clear the company has built a strong new business pillar.

With the stock cut in half from its high, I think investors can score wins by building long-term positions in Amazon. 

This software stock is way oversold

Jeremy Bowman (Okta): It might be an understatement to say that Okta (OKTA -1.27%) has had a rough year.

The cloud identity software company, which provides tools for employees and customers to log in and stay connected to the apps they need, has been a market darling since its 2017 IPO. But this year the stock has gone sour, down roughly 79%. It's also off roughly 83% from its lifetime high.

Okta had to contend with the same headwinds as much of the tech sector, which include fears of a recession and rising interest rates that pressured valuations. But the company also acknowledged in its second-quarter earnings report that it encountered some speed bumps in its integration of Auth0, the customer identity access software company it acquired last spring.

Additionally, Okta said it was starting to see sales cycles lengthen, and it stepped back from its long-term guidance of $4 billion in revenue and $800 million in free cash flow in fiscal 2026, which ends in January of that year.

However, at this point the stock looks oversold. Okta is trading at a price-to-sales ratio of less than 5, but its long-term growth prospects don't look too much different than they did a few months ago.

Revenue jumped 43% in its most recent quarter, showing growth remained strong, and current remaining performance obligations, or backlog, increased 36% to $1.5 billion.

More importantly, the company is taking steps to remediate the issue with Auth0. COO Frederic Kerrest said in an interview with The Motley Fool that Okta ramped up hiring to replace the sales reps that the company had lost in the integration, but was still in the process of training them. Okta also clarified products for its sales force and customers.

Finally, given the weakening macro climate, the company may be forced to delay its long-term revenue goal by a year or so. But, it will get there, and its shift to focus on profitability makes sense given the current market sentiment.

Okta is chasing an $80 billion addressable market and is widely considered the leader in cloud identity, though its run-rate revenue is still less than $2 billion, giving it plenty of room for growth.

Investors should take advantage of the sell-off and buy Okta before it bounces back. 

Playing the long game with Amazon and Okta could lead to big wins

While it's possible volatility will continue to shape the market in the near term, taking a buy-and-hold approach with strong companies remains one of the best ways to build wealth over the long term. Within that mold, Amazon and Okta have promising competitive advantages and untapped market opportunities that position them well for the future. And, sell-offs have pushed their respective valuations down to levels that leave room for very strong returns.