UST Interview Question

sql queries to write in window transformation function as well as same query to write in CTE