Domanda di colloquio di JFrog

Write an efficent algorithm, explain it and its performace limitations