Google interview question

OOPS bassed DSA Question- faced difficulty