Bloomberg interview question

Maximum subarray problem, desing a caching mechanism