SDRC interview question

oops and basic data structure