The Trade Desk interview question

Question about algorithm performance