EY interview question

Based on Oops, design patterns