Bank of America interview question

Optimize the given SQL query