This question was asked to me recently during an interview at a startup.
Given a stream of numbers define a function to determine the sum of the 1000 most recent numbers.