FastPrepMax Sum With No Two Adjacent Picks
Problems/Max Sum With No Two Adjacent Picks

Max Sum With No Two Adjacent Picks

DocuSign logoDocuSign● MediumINTERNOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: A report from April 2026 described an assessment round with two closely related coding problems. The candidate compared them to the well-known pick-without-neighbors problem, first along a line and then around a circle, and also called them graph problems.

The report gives no statement, limits or examples, and it does not explain the graph remark. This is the line version. Values sit in a row and you may not pick two neighbors. There are 1 to 1000 values from 0 to 10^4. We wrote the examples. The circle version is a separate problem.

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

You are given an integer array values. You may pick any set of positions in the array, but you may never pick two positions that are next to each other, such as positions i and i + 1.

Return the largest possible sum of the picked values. Picking nothing is allowed and gives a sum of 0.

Function

maxPickSum(values: int[]) → int

Examples

Example 1

values = [4,1,2,9,3]return = 13

Pick indexes 0 and 3: 4 + 9 = 13. They are not next to each other.

Index 4 cannot be added, because it is next to index 3. Every other allowed set is smaller, for example indexes 0, 2 and 4 give 4 + 2 + 3 = 9.

Example 2

values = [3,8,4]return = 8

Picking both ends gives 3 + 4 = 7. Picking the middle value alone gives 8, which is larger.

Example 3

values = [12]return = 12

There is only one value and nothing next to it, so pick it.

Constraints

  • 1 <= values.length <= 1000
  • 0 <= values[i] <= 10^4

More DocuSign Online Assessment questions

  • 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
  • Lowest Start That Keeps Running Totals PositiveOA · 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

  • 0/1 KnapsackConfluent · OAConfluent interview questions
  • Minimum Cost to Tile a Strip with Widths 1, 2, and 3Infosys · OAInfosys interview questions
  • Maximum Escape Game ScoreMicrosoft · OAMicrosoft interview questions
  • Maximum Subarray SumStraive · OA
  • Longest Increasing Price SubsequenceOpenAI · OAOpenAI interview questions
  • Lowest-Cost Shirt Color ScheduleElevenLabs · OAElevenLabs interview questions
  • Maximum Game Board ScoreJP Morgan Chase · OAJP Morgan Chase interview questions
  • API Bandwidth AllocationArista Networks · OAArista Networks interview questions
  • Maximum Points by Deleting ElementsIBM · OAIBM interview questions
  • House RobberWalmart · OAWalmart 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 maxPickSum(int[] values) {
        // Write your code here.
    }
}
Checking account…