NITS interview question

Sql question related to windows Function and the difference between CTE and Subquery