Amazon (AMZN  ) shares rallied 13% following the company's Q2 earnings which showed it beating on the top line and issuing better than expected guidance for the upcoming quarter. It was also remarkably consistent with what we are seeing with other companies in that it exceeded low expectations while giving some signs that the current struggles are short-term in nature.

Given Amazon's size and reach, its results give investors better insight into the economy as well. Some interesting notes are that it actually reduced headcount by 99,000 during the quarter as it focuses on cutting costs. Remember that Amazon's headcount more than doubled during the pandemic as it invested in new warehouses and distribution centers in order to meet increased demand for its services. Additionally, despite the serious economic headwinds, it was able to grow revenue by 7%.

Inside the Numbers

In Q2, Amazon reported a loss of $0.20 per share which was slightly more than expected. However, this included a $3.9 billion write-off of its Rivian (RIVN  ) stake as the EV maker's stock was down 50% in Q2. Overall, it's written off more than $11 billion. Operating income declined to $3.3 billion from $7 billion last year. Notably, AWS generated $5.7 billion in operating income.

Revenue topped expectations at $121.2 billion vs expectations of $119.1 billion which was 7% higher than last year's Q2.

Online sales saw a 4% decline in revenue, while physical stores had a 12% increase - another indication of changing consumer behavior. Amazon Web Services (AWS) continues to gain steam as it beat expectations at $19.7 billion, while analysts were expecting $19.56 billion, a 33% increase from last year.

Ad revenue saw a slowdown but still exceeded expectations at $8.8 billion vs. $8.7 billion and was 18% higher compared to last year. Despite the deceleration, this growth is impressive given that many ad platforms (FB  ) saw a decline in ad spending.

Next quarter, it sees revenue between $125 billion and $130 billion which equates to acceleration with revenue growth between 13% and 17%.

A major portion of its conference call was dedicated to talking about inflation and cost control. In terms of hiring, the company noted that it's not actively hiring in most parts of the company with some exceptions being high-growth areas like AWS and advertising.