Tech Mahindra interview question

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