Upwave interview question

SQL queries (medium) JS algorithm challenge (medium)