FastPrepDice Roll Simulation
Problems/Dice Roll Simulation

Dice Roll Simulation

Atlassian logoAtlassian● HardFULLTIMEOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in an Atlassian full-time online assessment. The report links to the exact Dice Roll Simulation exercise but does not copy its full statement. Our version follows that linked exercise. The function you write returns the resulting value.

Roll a six-sided die exactly n times. Face i + 1 may not appear more than rollMax[i] times consecutively.

Return the number of distinct valid roll sequences modulo 1,000,000,007.

Function

dieSimulator(n: int, rollMax: int[]) → int

Examples

Example 1

n = 2rollMax = [1,1,2,2,2,3]return = 34

Of the 36 length-two sequences, only 11 and 22 violate their run limits.

Constraints

  • 1 <= n <= 5000
  • 1 <= rollMax[i] <= 50
  • rollMax.length = 6

More Atlassian Online Assessment questions

  • Planning ProductionOA · Seen Feb 2025
  • K-Means ClusteringOA · Seen Feb 2025
  • Minimum Sorted Erasure OperationsOA · Seen Jun 2024
  • Count Analogous ArraysOA · Seen Mar 2024
  • Get Maximum ScoreOA · Seen Mar 2024
  • Better Compression 🦀OA · Seen Mar 2024
  • Romanizer 🐡OA · Seen Mar 2024
  • Flower Bouquets 💐OA · Seen Mar 2024
  • Binary Search Tree IteratorOA · Seen Nov 2023
  • Binary Tree Level Order TraversalOA · Seen Nov 2023

Similar questions at other companies

  • At Most K Jumps with Quadratic Transition CostInfosys · OAInfosys interview questions
  • Largest Consistent Visiting GroupAuxoAI · OA
  • 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
  • Maximum Sum of HeightsVirtu Financial · OAVirtu Financial interview questions
  • Pressure-Isolation Shutdown OrderIntuit · OAIntuit interview questions
  • Get Minimum IncrementIBM · OAIBM interview questions
  • Jump Game with Prime-3 StepsUber · OAUber interview questions
  • Maximum Payout with Context SwitchesPhonePe · OAPhonePe interview questions

Atlassian interview experiences

  • Atlassian MLE Phone Screen: Model Deployment Design: 1 Experience
  • Atlassian Coding Screens and Karat: 3 Experiences (Part 2 of 2)
  • Atlassian Full Stack Interviews: 11 Experiences (Part 1 of 2)
All Atlassian interview questionsSee Atlassian hiring insights
Saved
class Solution {
    public int dieSimulator(int n, int[] rollMax) {
      // Write your code here.
    }

}
Checking account…