FastPrepMaximum Barbell Weight
Problems/Maximum Barbell Weight

Maximum Barbell Weight

Virtu Financial logoVirtu Financial● HardFULLTIMEOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The interview report gives the plate weights, the capacity, the one-use rule, the goal, the limits, and the example. Our version keeps those details unchanged.

An athlete is loading plates onto a barbell with maximum capacity maxCapacity. The weight of each available plate is given by weights[i].

Choose any subset of the plates, using each plate at most once. Return the maximum total plate weight that does not exceed maxCapacity.

Function

weightCapacity(weights: int[], maxCapacity: int) → int

Examples

Example 1

weights = [7,1,5,6,2]maxCapacity = 7return = 7

There are three optimal ways to reach total weight 7: choose [7], [1,6], or [2,5].

Constraints

  • 1 <= weights.length <= 42
  • 1 <= maxCapacity <= 10^9
  • 1 <= weights[i] <= 10^9

More Virtu Financial Online Assessment questions

  • Count Substrings With Identical CharactersOA · Seen Oct 2026
  • HexSpeakOA · Seen Oct 2026
  • Maximum Apples That Fit in a BoxOA · Seen Oct 2026
  • Minimum Steps to a Fibonacci NumberOA · Seen Oct 2026
  • Stabilize Student Test ScoresOA · Seen Oct 2026
  • Maximum Sum of HeightsOA · Seen Sep 2026
  • Optimal Account BalancingOA · Seen Sep 2026
  • Reaching PointsOA · Seen Sep 2026
  • Banking Transaction ExceptionsOA · Seen Aug 2026
  • FIX Message ReconciliationOA · Seen Aug 2026

Similar questions at other companies

  • Maximum Barbell WeightSalesforce · OASalesforce interview questions
  • Split Array to Minimize the Largest SumInfosys · OAInfosys interview questions
  • Sliding Window MedianAuxoAI · OA
  • Optimize Discount Selection Under a Point BudgetPalantir · OAPalantir interview questions
  • Maximum Non-Decreasing Array LengthVisa · OAVisa interview questions
  • Pressure-Isolation Shutdown OrderIntuit · OAIntuit interview questions
  • Minimum Cost to Make Array EqualWalmart · OAWalmart interview questions
  • Maximize Array Beauty After DeletionsPoint72 · OAPoint72 interview questions
  • Longest Subarray with Sum at Most KGoogle · OAGoogle interview questions
  • Data ReorganizationGoldman Sachs · OAGoldman Sachs interview questions

Virtu Financial interview experiences

  • Virtu Financial New Grad Quant Trader HR Screen: 1 Experience
  • Virtu Financial Quant Trading Intern Onsite: 1 Experience
All Virtu Financial interview questionsSee Virtu Financial hiring insights
Saved
class Solution {
    public int weightCapacity(int[] weights, int maxCapacity) {
        // Write your code here.
    }
}
Checking account…