FastPrepNext Permutation
Problems/Next Permutation

Next Permutation

Atlassian logoAtlassian● MediumFULLTIMEOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in an Atlassian full-time online assessment. The report links to the exact Next Permutation exercise but does not copy its full statement. Our version follows that linked exercise and uses a fixed function interface.

Return the lexicographically next permutation of nums. If the current ordering is the greatest possible, return the smallest ordering. Duplicate values are allowed.

Function

nextPermutation(nums: int[]) → int[]

Examples

Example 1

nums = [1,2,3]return = [1,3,2]

Swapping the final two values gives the next greater ordering.

Constraints

  • 1 <= nums.length <= 10000
  • Values fit in a signed 32-bit integer.

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

  • Count Subarrays With Product Equal to KSalesforce · OASalesforce interview questions
  • Garden Sprinkler PlacementAirbnb · OAAirbnb interview questions
  • Count Belt Sections With K Fruit Pairs (Forward Deployed Engineer)Boston Consulting Group · OABoston Consulting Group interview questions
  • Maximum Easy Tasks After RearrangingIBM · OAIBM interview questions
  • Usable Water with Contaminated PillarsInfosys · OAInfosys interview questions
  • Latest Arrival to Catch a BusAutodesk · OAAutodesk interview questions
  • Minimum Last-Element RelocationsChubb · OAChubb interview questions
  • Generating Login CodesSnowflake · OASnowflake interview questions
  • Paint the CeilingWeRide · OAWeRide interview questions
  • Rotate an Array In PlaceAdobe · OA · PHONE SCREENAdobe 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[] nextPermutation(int[] nums) {
      // Write your code here.
    }

}
Checking account…