PI-Labs interview question

DSA based , Logic behind answers