The tech-heavy Nasdaq 100 index has gained over 3% in 2023, double the rise for the S&P 500. Shares of some megacap companies - which include those grouped outside of tech in sectors like communication services and consumer discretionary - have shot higher, with Amazon, Meta Platforms and Nvidia posting double-digit percentage increases.

Several factors are driving that outperformance, including investors piling into stocks they believe were overly punished in 2022. A moderation in bond yields, whose jump last year particularly pressured tech-stock valuations, is also likely helping the group, investors said.

Now, however, the focus is shifting to whether these companies can withstand a widely expected economic downturn while supporting valuations that some investors believe are too high.