Pregunta de entrevista de Dialpad

Problem regarding a decision tree kind of algorithm.