MongoDB Interview Question

Time complexity questions and analysis of code