MongoDB interview question

Space and time complexity analysis