L&T Power interview question

data structures, code and general coding