Pergunta de entrevista da empresa UpCodes

When do you consider to make a code refactoring?