Pregunta de entrevista de Meta

Just a basic question on algorithms.