FastPrepVehicle Builds for Required Terrain (Game Adaptation)
Problems/Vehicle Builds for Required Terrain (Game Adaptation)

Vehicle Builds for Required Terrain (Game Adaptation)

Roblox logoRoblox● MediumNEW GRADOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: This is a game version that we wrote. The candidate reports attaching parts to a robot to cross different kinds of terrain. This is a simpler exercise about counting setups. It is not the original game's physics or an interview coding question. We chose the part categories, yes-or-no abilities, how duplicate choices are told apart, and the limits. Our version is about 40% the same as the reported question.

The activity is building a vehicle to cross terrain, using the explicit capability model below.

For this exercise, choose exactly one part from every row of componentMasks. Each part has an integer mask describing its terrain capabilities. Combine the chosen parts with bitwise OR to get the vehicle’s capabilities. A build succeeds when its capability mask contains every bit set in requiredMask.

Return the number of successful builds. Each array position is a separate choice, even if it has the same mask as another position. Capabilities only add; parts never disable one another. If there are no categories, there is one empty build. It succeeds only when no capability is required. Keep all inputs unchanged.

Function

countTerrainBuilds(componentMasks: int[][], requiredMask: int) → long

Examples

Example 1

componentMasks = [[1,2],[2,3]]requiredMask = 3return = 3

Three of the four choices cover both required bits; choosing masks 2 and 2 does not.

Example 2

componentMasks = [[0],[1]]requiredMask = 3return = 0

No part supplies the second required bit.

Example 3

componentMasks = []requiredMask = 0return = 1

The empty build covers an empty requirement.

Constraints

  • 0 <= componentMasks.length <= 16.
  • Each category has 1..8 choices.
  • All masks are integers in 0..1023, using ten capability bits.
  • The result is at most 8^16 = 281474976710656 and uses signed 64-bit arithmetic.

More Roblox Online Assessment questions

  • Centered Block Placement QueriesOA · Seen Oct 2026
  • Robot Navigation Around LasersOA · Seen Oct 2026
  • Factory Batch Profit (Game Adaptation)OA · Seen Sep 2026
  • Nested Recipe Blocks (Game Adaptation)OA · Seen Sep 2026
  • Track Received Byte RangesOA · Seen Sep 2026
  • Break a PalindromeOA · Seen Jun 2026
  • Count Pairs Differing in One DigitOA · Seen Oct 2025
  • Find Zero Cells in a 2×2 GridOA · Seen Oct 2025
  • Cat Route Budget Planning (Game Adaptation)OA · Seen Aug 2025
  • Minimum Height Difference Between Distant PeaksOA · Seen Aug 2025

Similar questions at other companies

  • Bitwise XOR SubsequencesJP Morgan Chase · OAJP Morgan Chase interview questions
  • Bitwise XOR SubsequencesGoldman Sachs · OAGoldman Sachs interview questions
  • Delete K Subsets for Maximum ScoreRubrik · OARubrik interview questions
  • Optimize Discount Selection Under a Point BudgetPalantir · OAPalantir interview questions
  • Maximum Index-Weighted Sum with Disjoint SwapsVisa · OAVisa interview questions
  • Distinct OR Values of Increasing SubsequencesScale AI · OAScale AI interview questions
  • Minimum Cost for a Target WeightPace Stock Broking Services · PHONE SCREEN
  • Smallest Sufficient TeamExpedia · ONSITE INTERVIEWExpedia interview questions
  • Minimum Racks for Server ResourcesGoogle · PHONE SCREENGoogle interview questions
  • 0/1 KnapsackConfluent · OAConfluent interview questions

Interview reports that mention this question

  • Roblox New Grad CodeSignal Finals: 23 Experiences (Part 4 of 7)
  • Roblox New Grad Games and BQ: 25 Experiences (Part 3 of 7)
  • Roblox New Grad Coding Rounds: 23 Experiences (Part 2 of 7)
  • Roblox New Grad OA and Interviews: 137 Experiences (Part 1 of 7)

Roblox interview experiences

  • Roblox New Grad Early OA Tasks: 10 Experiences (Part 7 of 7)
  • Roblox New Grad Engineer Rounds: 13 Experiences (Part 6 of 7)
All Roblox interview questionsSee Roblox hiring insights
Saved
class Solution {
    public long countTerrainBuilds(int[][] componentMasks, int requiredMask) {
        // write your code here
    }

}
Checking account…