SpaceX interview question

How do you optimize this query