Goldman Sachs Group Inc (GS  ) CEO David Solomon acknowledged Monday the U.S. economy has held up better than he predicted, but he doesn't believe we are out of the woods yet.

What Happened: The economy is still in an uncertain period, the CEO said in a Monday "Squawk On The Street" interview on CNBC.

"The U.S. economy has been incredibly resilient and I would say that I have been surprised over the course of the last year," Solomon said. "While our economists again reduced their view on the chance of a recession in the U.S., I just think it's a period to be a little bit cautious."

Inflation might be a little bit more sticky than more are expecting, and growth may be sluggish moving forward, he said.

If we do enter a recession, Solomon said he expects it to occur at the end of the year or in the first half of 2024, but told CNBC that even if the economy doesn't tip into recession, it might feel like one if we end up facing 3.5% to 4% inflation and flat to 1% growth for an extended period of time.

It's possible that rates continue to climb as well, he added.

"In the distribution of outcomes, there's a reasonable chance that rates go higher. If they do that, it's probably going to make the economic environment a little more challenging," he said.

Regardless of what happens, it's smart to prepare for the possibility of at least a shallow recession, Solomon said. Accordingly, Goldman has been narrowing its headcount.

"We're always going to rightsize the business to the environment that we see," he said.

GS Price Action: Goldman Sachs shares were up 0.47% at $337.53 late Monday morning, according to Benzinga Pro.