FastPrepMaximum Forward Difference
Problems/Maximum Forward Difference

Maximum Forward Difference

Atlassian logoAtlassian● EasyFULLTIMEOA

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.

Return the maximum nums[j] - nums[i] over indices i < j with nums[i] <= nums[j]. Return -1 when no pair exists.

Function

maximumDifference(nums: int[]) → int

Examples

Example 1

nums = [7,2,3,10,1]return = 8

Choose 2 before 10; the later 1 cannot be paired backward with 10.

Constraints

  • 1 <= nums.length <= 100000
  • Values fit in a signed 32-bit integer and the result fits in int.

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

  • Catch Fish with Reusable BaitsSusquehanna International Group (SIG) · OASusquehanna International Group (SIG) interview questions
  • Server InvestmentRippling · OARippling interview questions
  • Book Reading EveningsGoogle · OAGoogle interview questions
  • Maximum Apples That Fit in a BoxVirtu Financial · OAVirtu Financial interview questions
  • Minimum Project Bid CostNVIDIA · OANVIDIA interview questions
  • Minimum AmountBelvedere Trading · OA
  • Maximum Income from Asset TradingJefferies · OA
  • Maximum Three-Server Difficulty ScoreVisa · OAVisa interview questions
  • Economical TripAccenture · OAAccenture interview questions
  • Best Time to Buy and Sell StockFlexTrade · OAFlexTrade 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 maximumDifference(int[] nums) {
      // Write your code here.
    }

}
Checking account…