Infosys Interview Question

They ask me the SQL Query on the Windows CTE and Subquery.