Pregunta de entrevista de URX

Algorithm questions and a couple design questions.