FOMO Pay interview question

Some background discussion and Some SQL