Deloitte interview question

SOLID design principles and a DSA problem