The overall stock market has been hit pretty hard recently. But many tech stocks have taken a worse beating, evident by the tech-heavy Nasdaq Composite's 9% decline since Oct. 1 versus the more evenly weighted S&P 500's 6% pullback in the same period. While some tech stocks may have been due for a correction, the decline for two prominent companies might have gone too far.

These stocks are Square (SQ 0.51%) and Apple (AAPL -0.81%), which have dropped 28% and 21%, respectively, since Oct. 1. For opportunistic investors, this may be a great time to buy.

Customer using Square's mobile payment solutions

Square Register. Image source: Square.

Square

Shares of financial technology company Square have been absolutely slammed recently. With that 28% drop since Oct. 1, Square has lost nearly a third of its value. The bearish narrative around the stock extends beyond the broader-market pullback in tech stocks. The company's stock also sank when news broke that Square CFO Sarah Friar said she planned to become CEO of Nextdoor (a social network for neighbors and communities) and when management provided a worse-than-expected outlook for fourth-quarter profits.

Though Square's stock has been in decline recently, its business has been thriving. Indeed, the company just posted is sixth consecutive quarter of accelerating revenue growth. In Square's third quarter, it surged 51% year over year -- up from 48% growth in Q2. Adjusted earnings before interest, taxes, and depreciation jumped 107% year over year to $71 million.

For investors looking to hold for the long haul, this could be a good time to pick up some shares of this fast-growing company.

Apple

Apple's stock has similarly been plagued recently by more than a tech sell-off. Numerous reports of worse-than-expected demand for the company's latest iPhones have weighed on it as investors wonder whether its most important business segment can keep growing.

In Apple's most recent quarter, iPhone revenue surged 29% year over year. But this quarter primarily represents the last full quarter of the iPhone X and iPhone 8 cycle; the iPhone XS wasn't released until the last few weeks of the quarter. Investors are worried that the latest iPhones won't be able to live up to tough year-ago comparisons. And Apple's guidance for total revenue to rise only 1% to 5% shows that even management expects the company's growth to slow.

But the stock's decline has priced in these concerns. Shares trade with a P/E of just 15. While a further decline is always possible, investors who buy at this level likely won't regret it a few years from now.