Amazon interview question

Some general LPs and python + sql