The stock market has dealt a tough hand to many investors in 2022, as prolonged volatility has afflicted virtually every sector to a certain degree. Even so, strong businesses with diverse catalysts for future growth can succeed beyond the current challenging period and enrich investors' portfolios in the process. 

That said, if you have $1,000 to invest in the current market, Microsoft (MSFT -0.15%) and Apple (AAPL 0.42%) are two smart stocks to consider loading up on before year's end. 

1. Microsoft 

Microsoft may be one of the most well-known names in tech, but that doesn't mean this giant has come close to exhausting its growth runway yet. The company is known by many investors for its productivity software, a market in which Microsoft controls a share to the tune of about 50%. Bear in mind, this is a market that hit a valuation of nearly $42 billion in 2020 and is expected to expand to roughly $123 billion by 2028.  

Another huge driver of Microsoft's current and future growth is the cloud infrastructure market. This is a space worth roughly $60 billion globally at the time of this writing, in which it controls a market share of 21% with its Azure cloud platform.  

The most recent quarter saw the company deliver revenue growth of 11% from the year-ago period to $50 billion, driven by a 24% jump in Microsoft Cloud revenue, a 9% jump in productivity and business processes revenue, and a 20% increase in intelligent cloud revenue. Microsoft remains highly profitable, with its net earnings in the most recent quarter totaling $18 billion.  

Microsoft is in a better position than most to ride out the volatility of the near-term market environment and continue delivering strong growth in the years ahead. Its software offerings remain daily-use essentials for individuals and businesses globally, and its hardware business continues to be a key factor in its overall growth with its lineup of PCs, accessories, headsets, laptops, gaming devices, and more. 

There's also a less-talked-about aspect of Microsoft's business, which is its advertising segment. While companies are pulling back on advertising spending in the near term, effective digital ad campaigns remain a must-have cost of doing business in order to remain competitive. While its ad business isn't yet at the scale of some other well-known tech giants, it hit a major revenue mark of $10 billion last year, while management is aiming to increase this figure to $20 billion in the years ahead. 

A $1,000 investment in Microsoft would add about four shares to your portfolio right now. 

2. Apple 

Apple is another tech giant that needs no introduction. Shares of Apple have taken a beating over the last few months, particularly as broad sentiment continues to go against tech-oriented growth stocks. Some investors also fear that a recessionary environment could slow down sales of Apple's key products, as these high-ticket items can be discretionary expenditures for households.

Apple still makes the lion's share of its revenue from smartphone sales and has a footprint of about 60% in the U.S. and 30% globally. Apple's market share within the global smartphone market, a space on track to hit just shy of $500 billion by the year 2026, is not only massive but growing. This can continue to be a durable driver of growth in the years to come, regardless of what happens in the near term. Even with the current macro situation, in the company's fiscal 2022, iPhone sales comprised about $205 billion of its total sales of $394 billion.  

However, Apple isn't resting on its laurels. It's rapidly expanding into new areas of growth that can drive revenue and profits in the future. From its foray into the buy now, pay later space to its expansion in the streaming market to its VR headset, which could launch in early 2023, to its small but growing advertising business, there are plenty of ways the tech giant can continue to disrupt new and emerging industries in the years ahead while delivering returns for shareholders. 

Apple's core products remain in demand and highly profitable. The company reported another year of steady growth in its fiscal 2022. Earnings jumped 4% year over year to $90 billion, and operating cash flow surged by a whopping $18 billion in the final quarter of the year alone.

This follows the trailing five years, in which Apple's revenue and earnings have grown by respective amounts of 131% and 170%, while the tech stock has delivered a total return of 720% for investors.  

A $1,000 investment in Apple would add approximately seven shares to your portfolio.