Fora Financial interview question

how to optimize EF query,