FastPrepColorful Increasing Subsequences
Problems/Colorful Increasing Subsequences

Colorful Increasing Subsequences

Atlassian logoAtlassian● HardINTERNFULLTIMEOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in an Atlassian online assessment for interns and full-time roles. Our version follows the whole prompt as shown in the report.

Each candle has a height and one of k colors. Count subsequences whose heights are strictly increasing and that contain every color at least once. Return the result modulo 10^9 + 7.

Function

countColorfulSubsequences(heights: int[], colors: int[], k: int) → int

Examples

Example 1

heights = [1,3,2,4]colors = [1,2,2,3]k = 3return = 2

The two valid subsequences choose height 1, either height 2 or 3, and height 4.

Constraints

  • 2 <= heights.length = colors.length <= 100
  • 1 <= k <= 7
  • 1 <= colors[i] <= k
  • 1 <= heights[i] <= 10^9

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

  • 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
  • Submask Sum QueriesIntuit · OAIntuit interview questions
  • Distinct Bitwise-OR Scores of Increasing SubsequencesWalmart · OAWalmart interview questions
  • Match an XOR-Adjusted SumSquarepoint Capital · OASquarepoint Capital interview questions
  • Madam C.J. Walker's Business PlanFortinet · OAFortinet interview questions
  • Count Divisible PermutationsDeloitte · OADeloitte interview questions
  • Get Distinct Goodness ValuesCitadel · OACitadel interview questions
  • Max ProfitIBM · OAIBM 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 countColorfulSubsequences(int[] heights, int[] colors, int k) {
      // Write your code here.
    }

}
Checking account…