Vodafone interview question

CTE's Based question fron sql