IKS Health interview question

Code on solid principles