Data Structures and Algorithms

Top Atlassian DSA Interview Questions & Solutions | 2025 Guide

Preparing for Atlassian’s Data Structures and Algorithms (DSA) interviews can feel overwhelming, but with the right strategy, you can crack them confidently. Whether you’re a recent graduate or an experienced developer, mastering DSA is key to landing a role at this tech giant. Sign up for free DSA resources to get started!

Understanding Atlassian’s DSA Interview Process

Atlassian’s interview process emphasizes problem-solving, algorithmic efficiency, and clean code. Engineers here solve complex scalability challenges daily, so your ability to optimize solutions matters.

Key Focus Areas in DSA Interviews

  1. Problem-Solving Skills: Interviewers assess how you break down problems and approach edge cases.
  2. Code Quality: Clean, modular code is a must.
  3. Optimization: Time and space complexity analysis is critical.
  4. Communication: Explain your thought process clearly.

A 2023 survey by Interview Kickstart found that 75% of Atlassian candidates face 2–3 DSA rounds, each lasting 45–60 minutes.

Evaluation Criteria Comparison

Criteria

Weightage

Example

Correctness

30%

Does the code handle all test cases?

Efficiency

40%

O(n) vs. O(n²) solutions

Readability

20%

Meaningful variable names

Communication

10%

Clarifying doubts upfront

Top Atlassian DSA Interview Questions and Solutions

Question 1: Reverse a Linked List in Groups of K

Problem Statement

Given a linked list, reverse every k nodes. If nodes remain, reverse them too.

Approach and Solution

  1. Iterative Reversal: Use pointers to track groups.
  2. Recursive Handling: Reverse remaining nodes if k > remaining length.
				
					def reverseKGroup(head, k):
    dummy = ListNode(0)
    dummy.next = head
    prev = dummy
    while prev.next:
        start = prev.next
        end = prev
        for _ in range(k):
            end = end.next
            if not end:
                return dummy.next
        next_group = end.next
        end.next = None
        prev.next = reverse(start)
        start.next = next_group
        prev = start
    return dummy.next

				
			

 

Optimization Tips:

  • Avoid recursion for large k to prevent stack overflow.
  • Time Complexity: O(n), Space Complexity: O(1).

Question 2: Find the Longest Palindromic Substring

Problem Statement

Given a string, return its longest palindromic substring.

Approach and Solution

  1. Expand Around Center: Check odd/even-length palindromes.
  2. Dynamic Programming: Store palindrome status in a 2D table.

Java Code:

				
					public String longestPalindrome(String s) {
    int maxLength = 0, start = 0;
    for (int i = 0; i < s.length(); i++) {
        int len1 = expand(s, i, i); // odd
        int len2 = expand(s, i, i + 1); // even
        int len = Math.max(len1, len2);
        if (len > maxLength) {
            maxLength = len;
            start = i - (len - 1) / 2;
        }
    }
    return s.substring(start, start + maxLength);
}

				
			

Optimization Tips:

  • Time Complexity: O(n²), Space Complexity: O(1).

Question 3: Check if a Binary Tree is a Valid BST

Problem Statement

Given the root of a binary tree, determine if it’s a valid Binary Search Tree (BST).

Approach and Solution

  1. In-Order Traversal: Verify that the traversal result is sorted.
  2. Recursive Min/Max Check: Track valid ranges for each node.

Java Code

				
					public boolean isValidBST(TreeNode root) {  
    return validate(root, Long.MIN_VALUE, Long.MAX_VALUE);  
}  

private boolean validate(TreeNode node, long min, long max) {  
    if (node == null) return true;  
    if (node.val <= min || node.val >= max) return false;  
    return validate(node.left, min, node.val) && validate(node.right, node.val, max);  
}  

				
			
Question 3_ Check if a Binary Tree is a Valid BST

Optimization Tips

  • Avoid integer overflow by using Long types.
  • Time Complexity: O(n), Space Complexity: O(h) (height of tree).

Question 4: Design a Circular Queue

Problem Statement

Implement a circular queue with enQueue, deQueue, Front, Rear, and isEmpty operations.

Approach and Solution

  1. Array-Based: Use a fixed-size array with front and rear pointers.
  2. Linked List: Dynamically manage nodes (better for variable size).
				
					class CircularQueue:  
    def __init__(self, k):  
        self.queue = [None] * k  
        self.size = k  
        self.front = self.rear = -1  

    def enQueue(self, value):  
        if self.isFull(): return False  
        if self.isEmpty(): self.front = 0  
        self.rear = (self.rear + 1) % self.size  
        self.queue[self.rear] = value  
        return True  

				
			

Optimization Tips

  • Handle edge cases like full/empty queues.
  • Time Complexity: O(1) for all operations.

Question 5: Minimum Window Substring

Problem Statement

Given two strings s and t, find the smallest substring in s that contains all characters of t.

Approach and Solution

  1. Sliding Window: Use two pointers and a hash map to track character counts.
  2. Expand/Shrink: Expand the right pointer until all characters are included, then shrink the left.

Java Code

				
					public String minWindow(String s, String t) {  
    int[] map = new int[128];  
    for (char c : t.toCharArray()) map[c]++;  
    int left = 0, right = 0, minLen = Integer.MAX_VALUE, count = t.length(), start = 0;  
    while (right < s.length()) {  
        if (map[s.charAt(right++)]-- > 0) count--;  
        while (count == 0) {  
            if (right - left < minLen) {  
                minLen = right - left;  
                start = left;  
            }  
            if (map[s.charAt(left++)]++ == 0) count++;  
        }  
    }  
    return minLen == Integer.MAX_VALUE ? "" : s.substring(start, start + minLen);  
}  

				
			

Optimization Tips

  • Use array instead of HashMap for faster lookups.
  • Time Complexity: O(n), Space Complexity: O(k) (k = unique characters in t).

Question 6: Merge Intervals

Problem Statement

Given an array of intervals, merge all overlapping intervals.

Approach and Solution

  1. Sort and Merge: Sort intervals by start time, then merge adjacent overlaps.

Python Code

				
					def merge(intervals):  
    intervals.sort(key=lambda x: x[0])  
    merged = []  
    for interval in intervals:  
        if not merged or merged[-1][1] < interval[0]:  
            merged.append(interval)  
        else:  
            merged[-1][1] = max(merged[-1][1], interval[1])  
    return merged  

				
			

Optimization Tips

  • Sorting dominates time complexity.
  • Time Complexity: O(n log n), Space Complexity: O(n).

Question 7: Detect Cycle in a Directed Graph

Problem Statement

Given a directed graph, check if it contains a cycle.

Approach and Solution

  1. DFS with Recursion Stack: Track visited nodes and recursion stack to detect back edges.
  2. Topological Sorting: Kahn’s algorithm (BFS-based) for cycle detection.

Python Code

Question 6_ Merge Intervals
				
					def hasCycle(graph):  
    visited = [False] * len(graph)  
    recursion_stack = [False] * len(graph)  
    for node in range(len(graph)):  
        if not visited[node]:  
            if dfs(node, graph, visited, recursion_stack):  
                return True  
    return False  

def dfs(node, graph, visited, recursion_stack):  
    visited[node] = True  
    recursion_stack[node] = True  
    for neighbor in graph[node]:  
        if not visited[neighbor]:  
            if dfs(neighbor, graph, visited, recursion_stack):  
                return True  
        elif recursion_stack[neighbor]:  
            return True  
    recursion_stack[node] = False  
    return False  

				
			

Optimization Tips

  • Time Complexity: O(V + E), Space Complexity: O(V).

Question 8: Implement LRU Cache

Problem Statement

Design an LRU (Least Recently Used) cache that supports get and put operations.

Approach and Solution

  1. Hash Map + Doubly Linked List: Use a hash map for O(1) access and a list to track usage order.

Java Code

				
					class LRUCache {  
    class Node {  
        int key, val;  
        Node prev, next;  
    }  
    private Map<Integer, Node> cache = new HashMap<>();  
    private int capacity;  
    private Node head, tail;  

    public LRUCache(int capacity) {  
        this.capacity = capacity;  
        head.next = tail;  
        tail.prev = head;  
    }  

    public int get(int key) {  
        if (!cache.containsKey(key)) return -1;  
        Node node = cache.get(key);  
        moveToHead(node);  
        return node.val;  
    }  
}  

				
			

Optimization Tips

  • Use LinkedHashMap in Java for simpler implementation.
  • Time Complexity: O(1) for both get and put.

Question 9: Maximum Subarray (Kadane’s Algorithm)

Problem Statement

Find the contiguous subarray with the largest sum.

Approach and Solution

  1. Kadane’s Algorithm: Track current and maximum sums iteratively.

Python Code

				
					def maxSubArray(nums):  
    max_sum = current_sum = nums[0]  
    for num in nums[1:]:  
        current_sum = max(num, current_sum + num)  
        max_sum = max(max_sum, current_sum)  
    return max_sum 

				
			
Question 9_ Maximum Subarray (Kadane’s Algorithm)

Optimization Tips

  • Handle all-negative arrays.
  • Time Complexity: O(n), Space Complexity: O(1).

Question 10: Validate Sudoku Board

Problem Statement

Determine if a 9×9 Sudoku board is valid (no duplicates in rows, columns, or 3×3 subgrids).

Approach and Solution

  1. Hash Sets for Rows, Columns, Subgrids: Use sets to track seen numbers.

Java Code

				
					public boolean isValidSudoku(char[][] board) {  
    Set<String> seen = new HashSet<>();  
    for (int i = 0; i < 9; i++) {  
        for (int j = 0; j < 9; j++) {  
            char num = board[i][j];  
            if (num != '.') {  
                String rowKey = num + " in row " + i;  
                String colKey = num + " in col " + j;  
                String boxKey = num + " in box " + i/3 + "-" + j/3;  
                if (!seen.add(rowKey) || !seen.add(colKey) || !seen.add(boxKey)) return false;  
            }  
        }  
    }  
    return true;  
}  

				
			

Optimization Tips

  • Single-pass solution using strings for keys.
  • Time Complexity: O(n²), Space Complexity: O(n²) 

Additional Preparation Tips for Atlassian DSA Interviews

Coding Practice Platforms

  • LeetCode: 300+ company-tagged questions.
  • HackerRank: Atlassian-specific challenges.
  • CodeSignal: Mock interviews with real-time feedback.

Platform Comparison

Platform

Atlassian Questions

Difficulty Range

LeetCode

150+

Easy–Hard

HackerRank

50+

Medium–Hard

CodeSignal

30+

Medium

Mock Interviews and Time Management

  • Practice with tools like Pramp or Interviewing.io.
  • Allocate 15 minutes for problem-solving and 10 minutes for coding.

FAQs About Atlassian DSA Interviews

What Resources Are Best for Atlassian DSA Prep?

Focus on platforms like LeetCode and HackerRank, and review Atlassian’s engineering blog for insights. For structured learning, enroll in GetSDEReady’s DSA Course to master core concepts.

Extremely! Atlassian prioritizes scalable solutions. Always discuss brute-force approaches first, then optimize. Learn optimization techniques via GetSDEReady’s System Design Course.

Yes! Questions on trees, graphs, and backtracking often require recursion. Strengthen your skills with GetSDEReady’s Web Development Course.

DSA, High & Low Level System Designs

Buy for 60% OFF
₹25,000.00 ₹9,999.00

Accelerate your Path to a Product based Career

Boost your career or get hired at top product-based companies by joining our expertly crafted courses. Gain practical skills and real-world knowledge to help you succeed.

Reach Out Now

If you have any queries, please fill out this form. We will surely reach out to you.

Contact Email

Reach us at the following email address.

Phone Number

You can reach us by phone as well.

+91-97737 28034

Our Location

Rohini, Sector-3, Delhi-110085

WhatsApp Icon

Master Your Interviews with Our Free Roadmap!

Hi Instagram Fam!
Get a FREE Cheat Sheet on System Design.

Hi LinkedIn Fam!
Get a FREE Cheat Sheet on System Design

Loved Our YouTube Videos? Get a FREE Cheat Sheet on System Design.