IKS Health interview question

Code on design patterns