Pregunta de entrevista de Lightspeed

Easy Coding challenge and a system design question.