FastPrepLowest Start That Keeps Running Totals Positive
Problems/Lowest Start That Keeps Running Totals Positive

Lowest Start That Keeps Running Totals Positive

DocuSign logoDocuSign● EasyINTERNOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: A report from February 2021 shared a photo of this online assessment question. The photo shows the task and three examples, but not the limits.

Here there are 1 to 1000 numbers, each from -10^6 to 10^6, so the answer always fits in a 32-bit integer. We wrote the examples.

Our version is about 95% the same as the reported question.

You pick a whole number x to start with. Then you add the numbers of the array arr to it one at a time, from left to right. After each addition you have a running total.

Return the smallest x such that:

  • x itself is at least 1, and
  • every running total x + arr[0] + ... + arr[i] is at least 1.

Function

minStart(arr: int[]) → int

Examples

Example 1

arr = [-2,5,-6,1]return = 4

Try x = 4. The running totals are 4 - 2 = 2, 2 + 5 = 7, 7 - 6 = 1 and 1 + 1 = 2. All of them are at least 1.

With x = 3 the third total would be 3 - 2 + 5 - 6 = 0, which is too small. So the answer is 4.

Example 2

arr = [2,3,1]return = 1

Every number is positive, so the totals only go up. The smallest allowed start, x = 1, already works: the totals are 3, 6 and 7.

Example 3

arr = [-7]return = 8

The only total is x - 7. It is at least 1 when x is at least 8.

Constraints

  • 1 <= arr.length <= 1000
  • -10^6 <= arr[i] <= 10^6

More DocuSign Online Assessment questions

  • Max Sum With No Two Adjacent PicksOA · Seen Apr 2026
  • Max Sum With No Two Adjacent Picks on a CircleOA · Seen Apr 2026
  • Beautiful Number OrderingsOA · Seen Feb 2026
  • Grid Path With the Most ClearanceOA · Seen May 2025
  • Vehicle Mixes for a Wheel TotalOA · Seen May 2025
  • Count Sales Rung Up at the Wrong PriceOA · Seen Feb 2021
  • Most Disjoint Intervals From Starts and DurationsOA · Seen Feb 2021
  • Fewest Fountains to Water the GardenOA · Seen Feb 2021
  • Fewest Student Groups Within a Level GapOA · Seen Nov 2020
  • Alphabetize a Word ListOA · Seen May 2020

Similar questions at other companies

  • Minimum Positive Starting ValueBooking.com · OA
  • Array Interval SumsHeadlands Technologies · OAHeadlands Technologies interview questions
  • Minimum AmountBelvedere Trading · OA
  • Online No-Intercept Linear RegressionTwo Sigma · OATwo Sigma interview questions
  • Range Sum QueriesIntuit · OAIntuit interview questions
  • Shortest Distance on a Circular Bus RouteAmazon · OA
  • Count Sortable SplitsGoogle · OAGoogle interview questions
  • Array Challenge (QR Intern)Akuna Capital · OAAkuna Capital interview questions
  • Range Negation UpdatesJP Morgan Chase · OAJP Morgan Chase interview questions
  • Threshold AlertsGoldman Sachs · OAGoldman Sachs interview questions

Interview reports that mention this question

  • DocuSign SWE Intern OA Questions: 53 Experiences (Part 1 of 2)

DocuSign interview experiences

  • DocuSign SWE Intern Interviews: 27 Experiences (Part 2 of 2)
All DocuSign interview questionsSee DocuSign hiring insights
Saved
class Solution {
    public int minStart(int[] arr) {
        // Write your code here.
    }
}
Checking account…