BNP Paribas Interview Question

Some basic SQL and general algo problem qs. Then 3 coding problems.