Google this week reported a steep decline in profits. Social media companies such as Meta said that advertising sales — the heart of its businesses — have rapidly cooled off. And Microsoft, perhaps the tech industry’s most reliable performer, predicted a slowdown through at least the end of the year.

Tech companies led the way for the U.S. economy over the past decade and buoyed the stock market during the worst days of the coronavirus pandemic. Now, amid stubborn inflation and rising interest rates, even the biggest giants of Silicon Valley are signaling that tough days may be ahead.

The companies are navigating the same problems as the rest of the economy. Pumped up by aggressive consumer spending during the pandemic, they invested to keep up with demand. Now, as that spending is slowing, they’re trying to adjust. It hasn’t been easy.