Barclays interview question

Questions regarding DS and OOPs