LinkedIn interview question

Given this problem (pasted on a notepad), write a SQL query to return the following