Samsung Research America interview question

Coding: maximum subarray sum.