This is a verified interview question from Rippling. Candidates reporting seeing this problem in recent Online Assessments (OAs) and onsite rounds. Mastering "Maximum-Sum Journey - Rippling OA" covers key patterns like DP.
"## Problem Statement — Maximum-Sum Journey Given an array `path` and an integer `maxStep`, a cursor starts at index `0` with an initial sum equal to `path[0]`. From its current position, the cursor may move right by any number of positions from `1` to `maxStep` (inclusive) in a single move. Whenever the cursor lands on a new position, the value at that position is added to the running sum. The cursor must eventually reach the last element of the array. Determine the maximum possible sum that can be obtained upon reaching the final position. ## Example `path = [10, 2, -10, 5, 20]` `maxStep = 2` One optimal journey is: * Start at index 0: sum = 10 * Move to index 1: sum = 12 * Move to index 3: sum = 17 * Move to index 4: sum = 37 Therefore, the maximum possible sum is 37."
Join thousands of developers practicing for Rippling.