Pregunta de entrevista de Google

Encountered a machine learning question, not coding at all