Thoucentric interview question

Coding from data structure. Time complexity.