← Atlassian Interview InsightsSoftware Engineer

Atlassian·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Jun 2026

Summary

Atlassian software engineer interview with a pretty standard algorithmic question. Nothing too brutal, but also not a lot to go on in terms of what the full loop looks like.

Questions Asked (1)

Q1

Given two strings s and t, determine whether s is a subsequence of t.

Algorithms & Data Structures
Author's notes

Two pointers, scan both strings once, done.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify the problem and edge cases, then propose a two-pointer greedy approach that scans t once while advancing through s. Explain the O(n) time and O(1) space complexity, and optionally mention follow-up considerations like binary search for multiple queries.

Pro tip: Demonstrate production maturity by discussing how you'd handle very large strings (streaming) and multiple queries (preprocessing t with positions for binary search), showing you think beyond the basic algorithm.

1. Clarify and define

Confirm that subsequence means characters in s appear in t in the same order but not necessarily consecutively. Ask about constraints (string lengths, character set) and edge cases like empty strings.

2. Propose the greedy two-pointer approach

Use one pointer for s and one for t; iterate through t, and when characters match, advance the s pointer. If the s pointer reaches the end, s is a subsequence.

3. Analyze complexity

State that the algorithm runs in O(n) time where n is the length of t, and uses O(1) extra space. Mention that this is optimal for a single query.

4. Handle edge cases

Discuss empty s (always true), empty t (true only if s is also empty), and s longer than t (immediately false). Walk through a small example to illustrate.

5. Discuss follow-ups and optimizations

If asked about multiple queries or very large t, mention preprocessing t by storing character positions and using binary search for each character of s, giving O(m log n) per query after O(n) preprocessing.

Key Points to Mention

  • Two-pointer technique with a single pass through t
  • Time complexity O(n) and space complexity O(1)
  • Edge cases: empty strings, s longer than t, no common characters
  • Greedy correctness: always matching the earliest possible character in t
  • Follow-up: binary search on preprocessed positions for multiple queries
  • Streaming scenario: algorithm works even if t is too large to fit in memory

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.