Meta Interview Question

SQL problem with case statements and joins