Tech companies are trimming staff and slowing hiring as they face higher interest rates and sluggish consumer spending in the US and a strong dollar abroad.