Rothesay interview question

Algorithms and data structures. Complexity.