Hitachi Data Systems Interview Question
Software Engineer / DevelopersCountry: United States
Interview Type: In-Person
is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.
CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.
Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.
Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.
One solution could be to iterate the array and make a sum (we'll call it currentSum) as you go. As long as currentSum + currentNumber >= 0 you keep adding the numbers to the currentSum, else you store the current sum in a maxSum variable if currentSum >maxSum and set you currentSum to 0 and continue with the next element in the array. Also to be able to print the subArray you would have to store the beginning and the end indexes of the subArray, so every time you begin a new currentSum you store the beginning index and then when you replace the maxSum with currentSum you have your end index, you store them as maxStartIndex and maxEndIndex or something. Then to print the subArray you just loop from maxStartIndex to maxEndIndex. I hope my explanation is understandable.
- Eddy May 04, 2017