Point72 interview question

Write a SQL query to solve this problem