FastPrepPeeking Iterator
Problems/Peeking Iterator

Peeking Iterator

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 Peeking Iterator exercise but does not copy its full statement. Our version takes one finite list of operations, so the same state changes can be checked with a single function.

Process peek, next, and hasNext against one iterator over nums. Peek returns the next value without consuming it, next returns and consumes it, and hasNext reports availability. Return results as strings.

Function

runPeekingIterator(nums: int[], operations: String[]) → String[]

Examples

Example 1

nums = [1,2,3]operations = ["peek","next","peek","next","hasNext"]return = ["1","1","2","2","true"]

Peek leaves the iterator position unchanged while next advances it.

Constraints

  • 1 <= nums.length <= 10000
  • Every peek and next operation is valid.
  • There are at most 20000 operations.

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

  • Bank Accounts with Balance HistoryMeta · OAMeta interview questions
  • Process Banking OperationsVercel · OA
  • Memory AllocatorTikTok · OATikTok interview questions
  • Adding Stack 2.0IMC Trading · OAIMC Trading interview questions
  • Integer Map Using a VectorAdobe · OAAdobe interview questions
  • Parcel Attribute Store with TTLAirbnb · OAAirbnb interview questions
  • Design an Ordered StreamBloomberg LP · OA · PHONE SCREEN · ONSITE INTERVIEWBloomberg LP interview questions
  • Customer Bootstrap APIDoorDash · PHONE SCREEN · ONSITE INTERVIEWDoorDash interview questions
  • Design Hit CounterCharta Health · PHONE SCREENCharta Health interview questions
  • Round-Robin Iterator over IteratorsBridge · ONSITE INTERVIEWBridge 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 String[] runPeekingIterator(int[] nums, String[] operations) {
      // Write your code here.
    }

}
Checking account…