Microsoft Interview Question
1,273 Interview Reviews |
Back to all Microsoft Interview Questions & Reviews
Interview questions and reviews posted anonymously by interview candidates
Interview Question for Software Developer Engineer In Test at Microsoft:
Maximum value contigous sub sequence. need to give all test cases
| Tags: | dynamic programming, linear time See more , See less 8 |
See more for this Microsoft Software Developer Engineer In Test Interview
Helpful Question?
Yes |
No
Inappropriate?



0 of 0 people found this helpful
by Interview Candidate:
{
int maxSum = a[0];
int currentSum = 0;
int alen = sizeof(a)/sizeof(a[0]);
for( int i = 0; i < alen; i++ )
{
currentSum += a[ i ];
if( currentSum > maxSum )
{
maxSum = currentSum ;
}
if( currentSum < 0 )
{
currentSum = 0;
}
}
return maxSum;
}