FastPrepMax Sum With No Two Adjacent Picks on a Circle
Problems/Max Sum With No Two Adjacent Picks on a Circle

Max Sum With No Two Adjacent Picks on a Circle

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 circle version. The first and last values are neighbors, and a single value can be picked. There are 1 to 1000 values from 0 to 10^4. We wrote the examples. The line version is a separate problem.

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

The numbers in values are placed around a circle in index order. Indexes that come one right after the other are neighbors. The circle closes on itself, so the last index, values.length - 1, and index 0 are neighbors too. For example, with 4 values the neighbor pairs are (0, 1), (1, 2), (2, 3) and (3, 0).

Choose a group of indexes that contains no neighbor pair, and add up the values at those indexes. Return the largest sum any such group can have.

An array with one number has no neighbor pair at all, so its only number may be chosen.

Function

maxPickSumCircle(values: int[]) → int

Examples

Example 1

values = [8,1,3,7]return = 11

On a line, indexes 0 and 3 would give 8 + 7 = 15. On a circle, index 3 is next to index 0, so that pair is not allowed.

The best allowed pair is indexes 0 and 2: 8 + 3 = 11. The other allowed pair, indexes 1 and 3, gives only 1 + 7 = 8.

Example 2

values = [5,4,6,4,5]return = 11

Indexes 0, 2 and 4 would give 16, but indexes 4 and 0 are neighbors on the circle.

With five values on a circle, at most two can be picked. The best pair is indexes 0 and 2 (or 2 and 4): 5 + 6 = 11.

Example 3

values = [12]return = 12

A single value has no neighbor, so pick it.

Constraints

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

More DocuSign Online Assessment questions

  • Max Sum With No Two Adjacent PicksOA · 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 maxPickSumCircle(int[] values) {
        // Write your code here.
    }
}
Checking account…