Infomedia interview question

Hackerrank questions was on classes and objects and recursion.