The tech giant last week announced plans to lay off nearly 4% of its workforce as it looks to rein in costs amid hefty investments in AI infrastructure.