TCS posted a 21% rise in quarterly profit, beating estimates, helped by a surge in outsourcing demand from overseas clients.