Sanofi Interview Question

SQL query based on window functions, joins