PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Coding & Algorithms/Atlassian

Check if one string is a subsequence of another

Last updated: Mar 29, 2026

Quick Overview

This question evaluates understanding of string algorithms and subsequence detection, focusing on sequence traversal, edge-case handling, and time/space complexity reasoning.

  • medium
  • Atlassian
  • Coding & Algorithms
  • Software Engineer

Check if one string is a subsequence of another

Company: Atlassian

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Technical Screen

Given two strings `s` and `t`, determine whether `s` is a **subsequence** of `t`. A subsequence keeps relative order but does not require contiguous characters. #### Input - `s`: a string (may be empty) - `t`: a string (may be empty) #### Output - Return `true` if `s` is a subsequence of `t`, otherwise return `false`. #### Examples - `s = "abc"`, `t = "aabzc"` → `true` (pick `a` at index 1, `b` at index 2, `c` at index 4) - `s = "axc"`, `t = "ahbgdc"` → `false` #### Constraints - `0 ≤ |s|, |t| ≤ 10^5` (assume ASCII letters) Follow-up (optional): If you need to answer this query for **dozens** of different `s` strings against the same `t`, what preprocessing (if any) would you do?

Quick Answer: This question evaluates understanding of string algorithms and subsequence detection, focusing on sequence traversal, edge-case handling, and time/space complexity reasoning.

Related Interview Questions

  • Compute a moving average on a stream - Atlassian (hard)
  • Find a secret word using match feedback - Atlassian (hard)
  • Implement sliding-window rate limiter function - Atlassian (medium)
  • Merge intervals and design rating APIs - Atlassian (medium)
  • Implement sequential and parallel URL requests - Atlassian (medium)
Atlassian logo
Atlassian
Jan 22, 2026, 12:00 AM
Software Engineer
Technical Screen
Coding & Algorithms
1
0
Loading...

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

A subsequence keeps relative order but does not require contiguous characters.

Input

  • s : a string (may be empty)
  • t : a string (may be empty)

Output

  • Return true if s is a subsequence of t , otherwise return false .

Examples

  • s = "abc" , t = "aabzc" → true (pick a at index 1, b at index 2, c at index 4)
  • s = "axc" , t = "ahbgdc" → false

Constraints

  • 0 ≤ |s|, |t| ≤ 10^5 (assume ASCII letters)

Follow-up (optional): If you need to answer this query for dozens of different s strings against the same t, what preprocessing (if any) would you do?

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Atlassian•More Software Engineer•Atlassian Software Engineer•Atlassian Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.