CST interview question

Data structures and algorithms. Javascript and React