D-Mart interview question

Basics