FastPrepVehicle Mixes for a Wheel Total
Problems/Vehicle Mixes for a Wheel Total

Vehicle Mixes for a Wheel Total

DocuSign logoDocuSign● EasyINTERNOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: A report from May 2025 lists this among its online assessment questions. You know a wheel total, and you count the four-wheeler and two-wheeler mixes that reach it.

The report gives no limits or examples. It does not say what happens when no mix fits, or whether a mix may skip one kind. Here the total is 1 to 10^9 and a mix may use only one kind. A total that no mix can reach, such as an odd one, returns 0. We wrote the examples.

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

There are two kinds of vehicles. A four-wheeler has 4 wheels and a two-wheeler has 2 wheels. You are told only the total number of wheels, totalWheels.

A mix is a pair of whole numbers: how many four-wheelers (f) and how many two-wheelers (t). It fits when 4 * f + 2 * t == totalWheels.

  • f and t can each be 0, so a mix may use only one kind of vehicle.
  • Two mixes are different when their f values differ or their t values differ.
  • If no mix fits, the answer is 0.

Return the number of different mixes that fit.

Function

countVehicleMixes(totalWheels: int) → int

Examples

Example 1

totalWheels = 12return = 4

Every mix with 12 wheels:

  • 0 four-wheelers and 6 two-wheelers: 0 + 12 = 12.
  • 1 four-wheeler and 4 two-wheelers: 4 + 8 = 12.
  • 2 four-wheelers and 2 two-wheelers: 8 + 4 = 12.
  • 3 four-wheelers and 0 two-wheelers: 12 + 0 = 12.

That is 4 mixes. A mix may leave out one kind of vehicle.

Example 2

totalWheels = 7return = 0

Every vehicle has an even number of wheels, so any mix has an even total. No mix reaches 7, so the answer is 0.

Example 3

totalWheels = 2return = 1

The only mix is one two-wheeler. Four-wheelers do not fit in 2 wheels.

Constraints

  • 1 <= totalWheels <= 10^9

More DocuSign Online Assessment questions

  • Max Sum With No Two Adjacent PicksOA · Seen Apr 2026
  • 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
  • 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

  • Count Valid Square PairsAuxoAI · OA
  • Counting Cows by Their LegsSusquehanna International Group (SIG) · OASusquehanna International Group (SIG) interview questions
  • Server InvestmentRippling · OARippling interview questions
  • Basic Item DiscountsPalantir · OAPalantir interview questions
  • Identification Number Check DigitAbridge · OAAbridge interview questions
  • Count Substrings With Identical CharactersVirtu Financial · OAVirtu Financial interview questions
  • Next Pascal Row CoefficientIntuit · OAIntuit interview questions
  • Digit-Sum Sequence Join PointOpenAI · OAOpenAI interview questions
  • Minimum Testers to Find the Poisoned BottleWalleye Capital · OA
  • Address on Same PageNVIDIA · OANVIDIA interview questions

Interview reports that mention this question

  • DocuSign SWE Intern Interviews: 27 Experiences (Part 2 of 2)
  • DocuSign SWE Intern OA Questions: 53 Experiences (Part 1 of 2)
All DocuSign interview questionsSee DocuSign hiring insights
Saved
class Solution {
    public int countVehicleMixes(int totalWheels) {
        // Write your code here.
    }
}
Checking account…