The Nasdaq Composite index has shed close to a third of its value so far in 2022 amid the broader stock market sell-off -- and it looks like things are going to get worse following the latest economic data; core inflation in the U.S. rose to a 40-year high in September. So another big rate hike may be in the cards from the Federal Reserve, which has adopted a hawkish approach to stifle the surging inflation.

This doesn't bode well for the stock market in general -- and growth stocks in particular. That's because higher interest rates lead to higher borrowing costs, affecting the bottom line. Consider tech giants like Apple (AAPL 1.66%) and Amazon (AMZN -0.17%).  Apple is the largest holding in Warren Buffett's Berkshire Hathaway portfolio, comprising nearly 41%, while Amazon is a much smaller constituent, accounting for 0.4%.

While Apple stock is down 20% in 2022, Amazon has dropped close to 31%. And they could head even lower in the near term if persistent inflationary conditions weaken consumer spending during the critical holiday shopping period. But savvy investors would do well to focus on the bigger picture and consider accumulating these stocks from Warren Buffett's portfolio while they are on their way down. Let's see why.

1. Apple

Apple stock has been in the news of late for the wrong reasons. The smartphone giant has reportedly slashed orders for the iPhone 14 models on account of weak demand. That's not so surprising as the smartphone market has been in bad shape this year with shipments declining amid rising inflation.

The smartphone weakness is bad news for Apple as the iPhone is its largest source of revenue, producing nearly half of the company's sales in the third quarter of fiscal 2022. But investors shouldn't lose sight of the bigger picture as Apple is dominating a fast-growing smartphone niche -- 5G devices. Strategy Analytics estimates that Apple controlled 31% of the 5G smartphone market in 2021. Its shipments were more than those of the next two vendors combined.

2022 has been a bad year for 5G smartphones thanks to the overall weakness in the market. Apple component supplier Qorvo has reduced its 5G smartphone shipment forecast for 2022 to a range of 650 million to 675 million units, down from the earlier estimate of 750 million units.

But with the growing deployment of 5G networks across the globe, annual sales of 5G smartphones are expected to hit 1.41 billion units by 2026 and account for 75% of the overall market. If Apple commands even a quarter of the 5G smartphone market after four years, its annual shipments could exceed 350 million units. That would be a big bump over its 2022 smartphone shipment forecast of 220 million units.

More importantly, Apple is pulling the right strings to ensure that it remains a dominant force in the 5G smartphone market. The company is successfully penetrating nascent but potentially lucrative markets such as India, a country that could add billions of dollars to its revenue in the long run.

Concurrently, Apple is building a sustainable revenue stream with its services business, which continues to grow at a nice pace thanks to the huge installed base of the company's devices. The services business generated $19.6 billion in revenue in the fiscal third quarter, up 12% over the prior-year period. And the segment accounts for 23% of the company's total revenue, so it should move the needle in a bigger way for the company as the installed base of Apple's devices grows thanks to catalysts such as 5G.

With Apple stock trading at 23 times trailing earnings, which is a sharp discount to the company's 2021 average of 31, it may be a good idea to buy this Warren Buffett favorite before its fortunes start turning around.

2. Amazon

Amazon has also seen a sharp decline in its shares -- down 31% decline in 2022. Some investors may fear that slower growth in online shopping this holiday season could weigh on Amazon, but analysts are upbeat about the company's long-term prospects. The company's earnings are expected to clock a compound annual growth rate of 33% for the next five years since it stands to win big from lucrative markets such as e-commerce and cloud computing.

The global e-commerce market, for instance, is expected to be worth $5.4 trillion by 2026, compared to $3.3 trillion at present, as per Morgan Stanley. The investment bank estimates that the online channel will account for 27% of all retail sales by 2026, compared to 22% now. This presents a secular growth opportunity for Amazon with its market share in lucrative e-commerce markets on the rise.

In the U.S., for example, Amazon had 50% share of the gross merchandise volume (GMV) in the online retail space, up from 34% in 2016. Meanwhile, the company is making solid progress in emerging markets such as India, where e-commerce is taking off. It reportedly controls over 30% of the Indian e-commerce market, which is expected to grow at an annual pace of 20% through 2025.

Similarly, demand for cloud computing is going to be another key catalyst for Amazon given its solid share of this market and the secular growth opportunity. With a market share of 34%, Amazon Web Services (AWS) is the leading player in the $200 billion cloud business. It is estimated that the global cloud computing market could exceed $1.5 trillion in revenue by the end of the decade, opening another great opportunity for Amazon to clock outstanding growth in the long run.

In all, this Warren Buffett holding could come out of its slump and soar. Meanwhie, the stock's price-to-sales ratio is down to 2.4, and the forward price-to-earnings multiple sits at 47. That's a sharp discount to its five-year average sales multiple of 3.9 and forward earnings multiple of 76. So investors looking to add an e-commerce stock to their portfolios may want to buy it while it is available at an attractive valuation.