HCLTech interview question

Case class explanation, tail recursion