Divami interview question

Basic oops based question, data structure and algorithm