← Atlassian Interview Insights

Atlassian·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Apr 2026

Summary

Atlassian software engineer screen, one coding question, pretty straightforward. Nothing that'll keep you up at night.

Questions Asked (1)

Q1

Given two strings s and t, write a function to check 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

Start by clarifying the problem and edge cases, then propose a two-pointer approach that iterates through t while advancing a pointer in s when characters match. Analyze time and space complexity, and discuss potential optimizations or alternative approaches like binary search for multiple queries.

Pro tip: Mention that for multiple queries with the same t, you can preprocess t to create a mapping of character positions and use binary search to answer each query in O(|s| log |t|) time, which is more efficient than the O(|s|+|t|) two-pointer approach per query.

1. Clarify the problem

Restate the problem in your own words and ask clarifying questions about input constraints, character sets, and expected output. Confirm that subsequence means characters appear in order but not necessarily consecutively.

2. Discuss edge cases

Identify edge cases such as empty strings, s longer than t, and identical strings. Explain how your solution handles them.

3. Propose a solution

Describe the two-pointer approach: iterate through t with index j, and for each character in s, advance j until a match is found or t is exhausted. If all characters of s are matched, return true; otherwise false.

4. Analyze complexity

State that the time complexity is O(|s| + |t|) and space complexity is O(1). Explain that each character in t is visited at most once.

5. Discuss optimizations and alternatives

Mention that for multiple queries with the same t, preprocessing t with a hash map of character positions and binary search can reduce per-query time to O(|s| log |t|). Also note that if s is very small, the two-pointer approach is optimal.

Key Points to Mention

  • Two-pointer technique: one pointer for s, one for t.
  • Time complexity: O(|s| + |t|) for a single query.
  • Space complexity: O(1) extra space.
  • Edge cases: empty s (always true), empty t (false unless s is empty), s longer than t (false).
  • Alternative approach for multiple queries: preprocess t with character positions and binary search.
  • Early termination: if remaining characters in t are fewer than remaining in s, return false.

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