FastPrepCount Bitonic Subsequences
Problems/Count Bitonic Subsequences

Count Bitonic 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.

Count non-empty subsequences that strictly increase to an interior peak and then strictly decrease. Both the increasing and decreasing parts must contain at least one step. Return the count modulo 10^9 + 7.

Function

countBitonicSubsequences(arr: int[]) → int

Examples

Example 1

arr = [1,2,3,2,1]return = 11

Eleven index-distinct subsequences have a strict rise followed by a strict fall.

Example 2

arr = [1,2,3,1]return = 4

The valid subsequences are [1,2,1], [1,3,1], [2,3,1], and [1,2,3,1].

Constraints

  • 1 <= arr.length <= 100000
  • 1 <= arr[i] <= 200

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

  • Range Maximum Subarray Sum QueriesInMobi · OAInMobi interview questions
  • Minimum Bridge TurnbacksBNSF Railway · OABNSF Railway interview questions
  • Maximum Profit from an Increasing Price TripletOdoo · OAOdoo interview questions
  • Longest Increasing Subsequence With Bounded Adjacent DifferenceGoogle · PHONE SCREENGoogle interview questions
  • Longest Increasing Subsequence With Bounded Adjacent DifferenceAmazon · PHONE SCREEN · ONSITE INTERVIEW
  • Volunteer Awards: Totals Divisible by KNutanix · ONSITE INTERVIEWNutanix interview questions
  • Expected Steps Until a Random Walk Gets Far From ZeroOptiver · OAOptiver interview questions
  • Magic Number Range CounterGraviton · OA
  • At Most K Jumps with Quadratic Transition CostInfosys · OAInfosys interview questions
  • Largest Consistent Visiting GroupAuxoAI · OA

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 countBitonicSubsequences(int[] arr) {
      // Write your code here.
    }

}
Checking account…