Palantir (PLTR 3.19%) and Amazon (AMZN 1.30%) both burned the bulls after their stocks hit all-time highs last year.

Palantir's stock started trading at $10 after the data-mining firm went public via a direct listing in September 2020. It soared to $39 last January amid the Reddit-fueled trading frenzy in "meme stocks," but it now trades at about $8. Amazon's stock closed at an all-time high of $3,731.41 last July, but it subsequently tumbled to about $2,200 as investors fretted over its slowing e-commerce growth and rising expenses.

Is either beaten-down tech stock worth buying as rising interest rates and other macro challenges challenge the entire sector?

A person holding a pen and looking at a computer screen.

Image source: Getty Images.

Palantir is losing its momentum

Palantir's data mining and analytics tools help government and commercial customers make informed decisions. Its government business, which aims to become the "default operating system for data across the U.S. government," has traditionally grown faster than its commercial business.

But over the past three quarters, its commercial business has grown at a faster rate than its government business. That slowdown raises troubling questions about brewing competition from other data mining platforms and internally developed alternatives within the U.S. government.

Palantir's revenue rose 47% to $1.09 billion in 2020 and grew 41% to $1.54 billion in 2021.

It insists it will generate at least 30% annual revenue growth through 2025, but it's off to a rough start this year: Its revenue rose 31% in the first quarter, but it expects just 25% growth in the second quarter. It believes its growth will improve in the second half of the year as it secures more "anticipated" contracts, but analysts expect just 29% growth this year.

Palantir's adjusted gross and operating margins also fell both sequentially and year over year in the first quarter of 2022. For the full year, it expects its adjusted operating margin to decline about four percentage points to 27% as it ramps up its investments "in advance" of future contracts. It isn't profitable on a generally accepted accounting principles (GAAP) basis yet, but analysts expect its non-GAAP EPS to improve 23% this year.

Palantir's business is still expanding, but its slowing growth, shrinking margins, and lack of GAAP profits made it an unappealing investment as the macro headwinds drove investors away from riskier growth plays.

Amazon faces tough post-pandemic challenges

Amazon generates most of its revenue from its e-commerce marketplaces, but most of its profits come from Amazon Web Services (AWS), the largest cloud infrastructure platform in the world. Both of these businesses fired on all cylinders throughout the pandemic, as more people shopped online and companies ramped up their spending on cloud-based services.

But as the lockdown measures were relaxed, Amazon's e-commerce growth decelerated while its expenses surged amid rising fuel costs, supply chain challenges, and other inflationary headwinds. It invested in the electric truck maker Rivian to offset those long-term costs, but that poorly timed investment resulted in a pre-tax loss of $7.6 billion (compared to its total net loss of $3.8 billion) last quarter.

That staggering loss tarnished the bullish thesis that Amazon could consistently subsidize its lower-margin retail business with AWS' higher-margin revenue. AWS is still the market leader and generating more than 30% revenue growth each quarter, but this core profit engine could struggle to offset the losses of Amazon's other businesses later this year.

Amazon's revenue rose 38% to $386 billion in 2020 and grew 22% to $470 billion in 2021. Its EPS increased 82% in 2020, even as it incurred billions of dollars of COVID-19-related expenses, and grew 55% in 2021. But this year, analysts expect its revenue to grow a mere 12% as its EPS tumbles 75%.

Just like Palantir, Amazon's toxic mix of slowing growth and rising expenses made it a difficult stock to own.

But Amazon has a better shot at a recovery

Palantir's stock trades at 43 times forward earnings and nine times this year's sales. It still isn't cheap relative to similar growth stocks like Twilio, which aims to generate more than 30% organic revenue growth through 2024 but trades at just five times this year's sales.

Amazon trades at 42 times forward earnings and two times this year's sales. That's a high price-to-earnings ratio for a traditional retailer but a low price-to-sales ratio for an e-commerce or cloud infrastructure company. Those mixed valuations should limit its downside potential, but Amazon's stock probably won't rally until its e-commerce business stabilizes.

I wouldn't rush to buy either of these stocks right now. But if I had to choose one over the other, I'd definitely stick with Amazon because it's larger, better diversified, and more profitable. Palantir's future is still highly speculative, and its recent slowdown suggests that its long-term target of at least 30% revenue growth through 2025 might be too ambitious.