FastPrepAlternating Parity Permutations
Problems/Alternating Parity Permutations

Alternating Parity Permutations

Atlassian logoAtlassian● MediumINTERNFULLTIMEOA

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.

Consider the distinct integers from 1 through n. Count permutations in which every adjacent pair has different parity.

Function

countGoodPermutations(n: int) → long

Examples

Example 1

n = 4return = 8

Choose whether odd or even comes first, then independently order the two odd and two even values.

Constraints

  • 1 <= n <= 11

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

  • Frog Paths Without Long RunsSusquehanna International Group (SIG) · OASusquehanna International Group (SIG) interview questions
  • Two Ranked Teams Meeting in a Random BracketOptiver · OAOptiver interview questions
  • Count Distinct Arrays After Decrement OperationsBloomberg LP · OABloomberg LP interview questions
  • Get Triplet CountIBM · OAIBM interview questions
  • Count Fancy NumbersHudson River Trading · OAHudson River Trading interview questions
  • Count Numbers with the Same Set-Bit CountMicrosoft · OAMicrosoft interview questions
  • Count Reverse-Digit PairsVisa · OAVisa interview questions
  • Get Triplet CountPoint72 · OAPoint72 interview questions
  • Count Shipment SchedulesMorgan Stanley · OAMorgan Stanley interview questions
  • Color a Grid with No Monochromatic Row or ColumnIntuit · OAIntuit 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 long countGoodPermutations(int n) {
      // Write your code here.
    }

}
Checking account…