Tech Mahindra Interview Question

Given an array of integers, write a function that returns the maximum sum of a subarray of the array.