Tiger Analytics interview question

Concept coding, probability , recursion, logical reasoning