Avito interview question

One SQL query, not very complex.