Growth stocks have experienced varying degrees of favor from investors over the last few years, but great businesses have persisted. While some companies have seen share prices rebound with the broader bull market, others are still dealing with depressed valuations.

However, if you're investing in stocks for five years, 10 years, 15 years, or even longer, you don't need to worry about what the market does in the next 12 to 18 months. Instead, you should focus on putting cash into quality businesses with strong competitive advantages, robust financials, and leadership in their respective markets.

Here are two such top growth stocks to consider if you have $1,000 to invest that you can leave in your portfolio for at least the next several years.

1. Microsoft

Microsoft (MSFT -1.30%) needs no introduction. This top tech stock continues to reward shareholders with generous returns through its impressive stock performance and steady dividend payments. Shares of Microsoft had a run up of around 35% over the last year, which, for reference, is notably higher than the S&P 500's performance of around 25% in that same time frame.

The company recently announced its quarterly dividend of $0.75 a share. While its yield is less than 1% -- which is not uncommon for businesses where share price performance is exceptional -- Microsoft habitually raised its dividend for 19 years in a row. It also maintains a payout ratio of around 25%.

As of the most recent quarter, Microsoft delivered earnings of $22 billion on revenue of $62 billion. Those figures represented increases of 23% and 17%, respectively, from the year-ago quarter. Microsoft's investments in artificial intelligence (AI) are a notable factor behind its current and forward-looking growth story. For example, the wide adoption of Microsoft's AI assistant Copilot helped the company's Cloud segment bring in a whopping $35 billion of revenue in the three-month period, a 23% increase from the prior year.

Copilot is integrated into the company's Microsoft 365 offerings, such as Word and Excel. Copilot also operates as a business chat that integrates all apps and data. A user can enter a prompt in Copilot to ask for information or data and receive an answer, such as details about the status of a pending project. Approximately 60% of the Fortune 500 now use Copilot.

Microsoft's AI-powered data analytics platform, called Fabric, is also witnessing explosive growth. Launched about a year ago, it had 11,000 users, ranging from companies like Lumen to Foot Locker. As for Azure's OpenAI-powered service, which helps users build their own generative AI applications, this is now utilized by 65% of the Fortune 500.

Looking at Azure broadly, the cloud computing platform saw its cohort of deals with clients valued at over $100 million jump by an incredible 80% year over year in the most recent quarter. Even properties like LinkedIn now feature AI elements. Management noted in the recent earnings call that AI-assisted messages on the networking platform are witnessing a 40% higher acceptance rate.

In May, Microsoft announced its new line of Copilot+ PCs. These new PCs feature a range of AI features, including a dedicated Copilot key for users to easily reach its flagship AI assistant, unique AI experiences like an image-generation tool and translation tool, and new audio and video effects.

The runway to growth for this company continues to expand, and the opportunities in AI are virtually endless. This is the kind of business you can buy and hold for a lifetime. Microsoft appears to be proving that thesis true time and time again.

2. Lululemon

Lululemon (LULU -3.11%) hasn't been performing well along with the broader resurgence the market has experienced. Shares are trading down by around 40% from where the stock was a year ago.

What seems to be the issue here? Well, Lululemon is still profitable, revenue is growing steadily, and its cash position is solid. The company continues to expand its global footprint and open new stores.

Lululemon previously identified a series of aggressive growth objectives, including the goal of reaching $12.5 billion in annual revenue by 2026. It doesn't look to be too far away from achieving that aim, considering the company brought in just shy of $10 billion in revenue in full-year 2023.

Some investors might be worried about how the company will perform if economic conditions worsen. After all, athleisure clothing and accessories don't exactly fall into the category of essential spending.

On the flip side, athleisure is popular among consumers of all ages, both for its functionality and comfort as well as for its versatility. Lululemon also benefits from a considerable place of market dominance while also garnering incredible versatility.

In the first quarter of 2024, Lululemon's net revenue rose 10% year over year to $2.2 billion. This was driven by a 3% net revenue increase in the Americas, and a 35% revenue increase in its international markets. Gross margin rose 20 basis points from the year-ago period to 57.7%.

As for profitability, Lululemon's net income rose 11% from the year-ago quarter to $321 million. It ended the quarter with 711 stores open, up from 686 the prior quarter. It also had a cash position of approximately $2 billion on its balance sheet.

The company is coming from a place of financial strength, which can lend stability if consumer sentiment worsens. This is certainly a risk factor to be aware of, but if you're investing in the business for several years at least, you might still want to take a look at Lululemon stock.