Nielsen interview question

Data structure algortihm medium to hard