Pregunta de entrevista de Oracle

In second round of technical interview ,I was asked to write the code to find the sub array having maximum sum. the array can contain both positive and negative numbers.