eBay Interview Question
106 Interview Reviews |
Back to all eBay Interview Questions & Reviews
Interview questions and reviews posted anonymously by interview candidates
Interview Question for Software Engineer at eBay:
Helpful Question?
Yes |
No
Inappropriate?
0 of 0 people found this helpful
by Interview Candidate:
int totalSum = 0;
for (int i=0; i < a.length; ++i) {
if (curSum <= 0) {
curSum = a[i];
} else {
curSum += a[i];
}
if (curSum > totalSum) {
totalSum = curSum;
}
}
return totalSum;