With recession fears mounting—and inflation, the war in Ukraine and the lingering pandemic taking a toll—many tech companies are rethinking their staffing needs, with some of them instituting hiring freezes, rescinding offers and even starting layoffs.