I recently watched the movie “Good Will Hunting” again, and Will has the following conversation through a cafe window.
“Will: Do you like apples? Clark: What? Will: Do you like apples? Clark: Yeah. Will: Well, (holding a piece of paper with a telephone number written on it against the window) I got her number. How do you like them apples?”
Wikipedia and other sources speculate the expression came from World War I when allied soldiers used mortar shells they called “toffee apples” (candied apples that have a stick in them to hold them while being eaten). Soldiers may have shouted the phrase across the lines “in sort of a victory cry” after a mortar shell hit the target.
The first known printed use was in a U.S. Army unit’s history. A soldier used the remark to express disappointment when he was told the unit was not going to receive many supplies.