Warren Buffett and David Tepper might not seem to have a lot in common -- aside from the fact that they're both wildly successful investors. Buffett is much more cautious by nature and usually shies away from tech stocks. Tepper is aggressive and invests heavily in the tech sector.

But these billionaires share at least a few common denominators. Here are the only "Magnificent Seven" stocks that both Buffett and Tepper own.

Great minds think alike -- sometimes

Tepper's Appaloosa Management hedge fund has positions in most of the Magnificent Seven stocks. The fund's top four holdings are Meta Platforms, Microsoft (MSFT 1.82%), Amazon (AMZN 3.43%), and Nvidia. Google parent Alphabet (GOOG 9.96%) (GOOGL 10.22%) ranks as Appaloosa's seventh-largest position. There are only two Magnificent Seven stocks that Tepper doesn't own -- Apple and Tesla.

Buffett is a huge fan of Apple. Last year, he told Berkshire Hathaway shareholders at their annual meeting that Apple was "a better business than any we own." It's by far the biggest position for Berkshire, accounting for nearly 43% of the conglomerate's portfolio.

Unlike Tepper, though, Buffett hasn't loaded up on several other Magnificent Seven stocks. The only member of the group besides Apple in Berkshire's portfolio is Amazon. So, is Amazon the only Magnificent Seven stock that both Buffett and Tepper own? Actually, no.

Berkshire Hathaway's subsidiary, New England Asset Management (NEAM), manages its own investment portfolio. NEAM has small stakes in Alphabet and Microsoft. Therefore, Buffett has positions in these Magnificent Seven stocks also.

Big winners for the two billionaires

All three of these Magnificent Seven stocks owned by Buffett and Tepper have been big winners. Amazon especially stands out, with a gain of nearly 80% over the last 12 months.

The generative AI boom has provided a nice tailwind for Amazon as customers built AI apps on its Amazon Web Services (AWS) cloud platform. Amazon's efforts to increase its profitability have also paid off handsomely.

Microsoft's shares have soared close to 50% over the last 12 months. Again, generative AI served as the key catalyst behind this impressive performance. Microsoft integrated OpenAI's GPT-4 AI model throughout its products, appealing to customers seeking to harness the power of generative AI.

Some investors might have thought that Alphabet was being left in the dust by Microsoft and OpenAI. However, the tech stock has jumped around 45% over the last 12 months. Alphabet's Google Cloud business is benefiting from the surging interest in generative AI just as AWS and Microsoft's Azure cloud platform are.

Are Amazon, Alphabet, and Microsoft magnificent stocks to buy now?

Just because Buffett and Tepper own Amazon, Alphabet, and Microsoft doesn't mean you should buy them too. There are some knocks against these members of the Magnificent Seven.

E-commerce isn't the fast-growing market for Amazon that it once was. AI could present a threat to Alphabet's Google Search advertising revenue. Microsoft's valuation is frothy, with shares trading at more than 31 times forward earnings.

However, I think that the pros outweigh the cons for all three stocks. The cloud units of Amazon, Alphabet, and Microsoft should have tremendous growth prospects. Amazon is expanding into new markets, notably including health care. Alphabet's Waymo self-driving car business could be a game changer. Microsoft is a more formidable player in gaming with its acquisition of Activision Blizzard.

Sure, these stocks could take a breather after racking up massive gains. For long-term investors, though, I think that Amazon, Alphabet, and Microsoft remain magnificent stocks to buy.