“We’re investing for the large opportunities we have in front of us,” Tom Szkutak, the company’s chief financial officer, said in a conference call.

While Amazon is feared as a seller of physical goods, it faces several formidable rivals in the digital content business, including Netflix, Apple, Hulu, Microsoft and Google.

Still, Amazon is also spending aggressively on the warehouses it needs to deliver physical goods, building them in locations that have been inching ever closer to big cities with the goal of offering next-day, or even same-day, deliveries to shoppers. This year, Amazon began selling groceries in the Los Angeles area, using its own trucks to shuttle fruit, meat and boxes of cereal from a new warehouse in the city to customers’ doorsteps.

The effort is expensive and risky, though Amazon would not say whether or how much money it was losing on it. The grocery business has killed Internet retailers before — Webvan was the most notable casualty — so Amazon chose not to expand the service beyond a test in Seattle until recently.

“The challenge we’ve had over the past several years is how to make it economically viable,” Mr. Szkutak said.

All the spending on warehouses and other projects has led to a surge in hiring at the company. Its head count swelled to 97,000, up more than 40 percent from 69,000 a year ago. The hiring earned the company a plum position as the backdrop for a speech on middle-class jobs that President Obama is expected to deliver on Tuesday at an Amazon warehouse in Chattanooga, Tenn.

A big part of Amazon’s allure for investors remains its pre-eminent position in e-commerce, which is expected to rise 14.8 percent to $248 billion in American sales this year, according to eMarketer. That is far better growth than the single-digit growth expected for retail sales over all in the United States this year.