FastPrepMaximum Weighted End-Pick Score
Problems/Maximum Weighted End-Pick Score

Maximum Weighted End-Pick Score

Google logoGoogle● HardNEW GRADPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The Google ML new-grad report describes a similar question with ordered multipliers and end removals. Its author corrects a discussion example to score 6 because every pick uses its multiplier. Numeric bounds are specified for this exercise. Approximate source match: 95%.

Choose exactly multipliers.length numbers from nums. At each step, remove either the first or last remaining number. Multiply the number chosen at zero-based step i by multipliers[i] and add it to the score.

Return the largest possible total score. The multiplier order is fixed, and every multiplier must be used, even when all possible totals are negative.

Function

maximumWeightedEndScore(nums: int[], multipliers: int[]) → long

Examples

Example 1

nums = [1,2,-3,4]multipliers = [1,1,-1,-1]return = 6

Pick 1, 4, -3, 2: their weighted total is 1 + 4 + 3 - 2 = 6.

Example 2

nums = [1,2,3]multipliers = [3,2]return = 13

Choose 3 and then 2 from the right: 3 * 3 + 2 * 2 = 13.

Example 3

nums = [-5,-2,-4]multipliers = [1,1]return = -6

Choose -4 and then -2; exactly two picks are required.

Constraints

  • 1 <= nums.length <= 100000.
  • 1 <= multipliers.length <= min(nums.length, 200).
  • Every number and multiplier lies between -10^6 and 10^6.
  • Return a signed 64-bit total.

More Google Phone Screen questions

  • Route Pattern MatcherPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Periodic-Color Binary Forest RootsPHONE SCREEN · Seen Nov 2026
  • Evaluate a Nested Math ExpressionPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Best Stock Trade with Buy and Sell DaysPHONE SCREEN · Seen Nov 2026
  • Word Chain Jumps in a GridPHONE SCREEN · Seen Nov 2026
  • Dice-Walk Winning ProbabilityPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Lowest Common Ancestor in an N-ary TreePHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Apartment Housemate PreferencesPHONE SCREEN · Seen Nov 2026
  • Price at Query TimestampsPHONE SCREEN · Seen Nov 2026
  • Course Schedule Cycle DetectionPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026

Similar questions at other companies

  • Split Array to Minimize the Largest SumNation with NaMo · PHONE SCREEN
  • Trapping Rain WaterOracle · PHONE SCREENOracle interview questions
  • Minimum Length After Removing Arithmetic TriplesMedia.net · PHONE SCREEN
  • Select Transactions with Child-Pays-for-Parent PackagesCoinbase · PHONE SCREENCoinbase interview questions
  • Longest Consistent Activity StreakAtlassian · PHONE SCREENAtlassian interview questions
  • Longest Increasing Path in a MatrixNew Relic · PHONE SCREEN · ONSITE INTERVIEW
  • Longest Increasing Subsequence With Bounded Adjacent DifferenceAmazon · PHONE SCREEN · ONSITE INTERVIEW
  • Maximum Profit with at Most K TransactionsTekion · PHONE SCREENTekion interview questions
  • Count Ordered Combination Sums with Negative ValuesPinterest · PHONE SCREENPinterest interview questions
  • Minimum Matrix-Chain MultiplicationsGSA Capital · PHONE SCREEN

Google interview experiences

  • Google interviews · November 2026
  • Google Software Engineer Onsite Questions: 10 Experiences
  • Google OA: What It Tests (2026)
  • Google L4 SWE Phone Screen: 1 Experience
  • Google ML Engineering Manager Onsite: 1 Experience
  • Google Experienced SWE First Round and Onsite: 1 Experience
All Google interview questionsSee Google hiring insights
Saved
class Solution {
    public long maximumWeightedEndScore(int[] nums, int[] multipliers) {
        // Write your code here
    }
}
Checking account…