Investors of all stripes look up to Warren Buffett as someone who knows how to make money no matter what the stock market throws at him. Since he acquired Berkshire Hathaway in 1965, the defunct textile mill has grown into a conglomerate with a $594 billion market cap.

Shares of Berkshire Hathaway have delivered gains at a compound annual growth rate of 19.6% over the past 57 years. In its early days, the conglomerate dealt with more inflation than we're seeing today, and since then it's survived a handful of nasty recessions and come out the other end shining like a new dime.

Johnson & Johnson (JNJ -1.82%) and Amazon.com (AMZN -0.17%) are some of the largest holdings in Berkshire's portfolio. Here's how both of these stocks are poised to deliver market-beating gains for patient investors. 

Johnson & Johnson

You're most likely familiar with century-old consumer health brands from Johnson & Johnson such as Band-Aids and Listerine. What you probably don't realize is that med-tech and pharmaceuticals are responsible for the vast majority of this company's total revenue stream.

Now's a particularly good time to buy J&J shares because the company plans to spin off its consumer segment into a new company. This means investors who buy the stock now will end up owning shares of two companies in 2023. 

The new consumer goods company is expected to plod along at a growth rate that's hardly perceptible. The J&J that remains, though, will be a sleeker machine capable of growing faster than the company can in its current state. 

Investors can expect strong growth from J&J thanks in part to soaring sales of Tremfya, a psoriasis drug with first-quarter sales that surged 41% year over year to an annualized $2.4 billion. In its med-tech segment, demand for electrophysiology products used to keep hearts beating properly is on the rise and could go a long way to drive growth over the long run. 

At recent prices, J&J offers a 2.6% dividend yield. This isn't a very high percentage now, but investors can bank on it rising steadily. This company has raised its payout for 60 consecutive years, and operations can easily support another raise. The company needed just 57% of the free cash flow its operations generated over the past year to meet its dividend obligations.

Amazon

Amazon is best known for its online marketplace, but this alone isn't the reason Buffett acquired the stock. In addition to somewhat unpredictable retail sales, an estimated 200 million people regularly renew their Prime subscriptions. This gives the retail operation steady cash flows so it can run on razor-thin margins at prices its rivals struggle to compete with.

In 2020 and 2021, Amazon doubled the size of its fulfillment network in order to keep up with surging demand. Now that we're back to business as usual, those new fulfillment centers are a drag on the bottom line. As a result, the company posted a loss of $3.8 billion in the first quarter. 

It's probably just a matter of time before online sales catch up with operating expenses again. In the meantime, a "Buy with Prime" program will help keep all those new fulfillment centers busy. 

Amazon's diversification is helping it weather a retail downturn and could allow it to remain buoyant even if the U.S. enters a deep recession. Its cloud services segment, Amazon Web Services (AWS), is the company's largest source of profits, and it's growing fast. In the first quarter, AWS generated a $6.5 billion operating profit that was 57% more than the previous year's period.

The loss Amazon reported for the first quarter is disturbing, but it isn't a reason to avoid the stock now. With more than $36 billion in cash on its balance sheet and diverse sources of revenue that include a leading cloud services business, Amazon appears destined to produce strong profit growth in the years to come.