Deloitte Interview Question

SOLID design principles and a DSA problem