Pergunta de entrevista da empresa AT&T

What is the formula to calculate subnets?