Duolingo Interview Question

A medium level difficulty SQL problem