Pregunta de entrevista de Uber

General algorithm question and system design