Quotient interview question

Programming, data structures, sql, logical reasoning