Avito Interview Question

One SQL query, not very complex.