Capgemini interview question

Given one code to provide the output. Seems lime the complex one.. Questions on data structure and algorithm