FastPrepMake the Array Positive
Problems/Make the Array Positive

Make the Array Positive

Atlassian logoAtlassian● HardFULLTIMEOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

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

An operation replaces any one array value with any signed 64-bit integer. An array is positive when every contiguous subarray of length greater than one has non-negative sum. Return the minimum operations required.

Function

getMinOperations(arr: int[]) → int

Examples

Example 1

arr = [2,5,-8,-1,2]return = 1

Replacing -8 with a sufficiently large positive value makes every length-at-least-two subarray non-negative.

Constraints

  • 1 <= arr.length <= 100000
  • -10^9 <= arr[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

  • Minimum Circular Redistribution CostAmazon · OA
  • Running Through Walls with Limited EnergyScale AI · OAScale AI interview questions
  • Minimum Cost K-Capable ModelsMicrosoft · OAMicrosoft interview questions
  • Optimal TransferSnowflake · OASnowflake interview questions
  • Minimum AmountBelvedere Trading · OA
  • Gas Station Loop StartNutanix · OANutanix interview questions
  • Focus on Efficiency (2024 NG)Google · OAGoogle interview questions
  • Redistribute MegaseedsRubrik · OARubrik interview questions
  • Maximum Distinct Items Within a BudgetAdobe · OAAdobe interview questions
  • Maximize Compatible Car RidersUber Freight · PHONE SCREEN · ONSITE INTERVIEWUber Freight 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 getMinOperations(int[] arr) {
      // Write your code here.
    }

}
Checking account…