noon interview question

more question on window functions and join logic