Shares of tech giant Apple (AAPL 1.27%) have risen sharply in recent weeks. The stock has climbed about 15% in the last 30 days alone, recovering from a slump that has persisted since late January.

Bullishness in the market for the tech stock comes ahead of Apple's fiscal third-quarter earnings report, which is set to be released on July 27. Will the company be able to live up to the market's optimism for the stock? More importantly, is now a good time to buy the stock or have shares become overpriced?

A man wearing Apple AirPods Max headphones.

Image source: Apple.

Impressive growth

Apple set a high bar when it reported its fiscal second-quarter results in April. Revenue during the period soared 54% year over year, crushing analysts' estimates. Of course, the period was expected to be somewhat of an anomaly due to an easy comparison in the year-ago quarter when Apple was facing supply shortages and weak demand in China amid COVID-19 lockdowns. Still, growth was higher than expected -- far higher. On average, analysts expected revenue of $77.4 billion yet the tech company's actual top line came in at an incredible $89.6 billion. Earnings per share was $1.40, beating a consensus forecast for $0.99. 

It was a blockbuster quarter, to say the least.

Of course, these strong results mean expectations are high for Apple's fiscal Q3. On average, analysts expect Apple's fiscal third-quarter revenue to increase 22% year over year. While this is a much lower growth rate than what Apple saw in fiscal Q2, investors should note that the tech giant is up against a tougher year-ago comparison. 

A cash cow worth a premium price

While it's impossible to know what Apple will report later this month or how the market will react to that report, the tech stock is arguably attractive in relation to its underlying fundamentals.

Yes, Apple may have an astounding $2.4 trillion dollar market capitalization. But it also notably has more than $204 billion in cash and marketable securities ($83 billion net of its debt) and it is generating over $90 billion of free cash flow on a trailing-12-month basis. Further, Apple's gross profit margin has been expanding recently thanks to its fast-growing services business, which commands a gross profit margin that is about twice that of its products business.

Based on the company's recent growth and its fundamentals, Apple shares seem to justify their high price-to-earnings ratio of 32. This doesn't mean the stock may not trade lower at some point in the future. But the long-term prospects for the stock from this level do seem compelling.

Investors will be able to find a copy of Apple's earnings release when it is posted on the company's investors relations webpage after market close on Tuesday, July 27.