RainFocus interview question

SQL, some basic algos and complexity questions