Mphasis Interview Question

Oops and solid principal , basic data structure