Check if one string is a subsequence of another
Company: Atlassian
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: medium
Interview Round: Technical Screen
Quick Answer: This question evaluates understanding of string algorithms and subsequence detection, focusing on sequence traversal, edge-case handling, and time/space complexity reasoning.
Constraints
- Inputs are Python literals matching the function signature.
- Return a deterministic exact-match value.
Examples
Input: ('abc','aabzc')
Expected Output: True
Explanation: abc appears in order.
Input: ('axc','ahbgdc')
Expected Output: False
Explanation: x cannot be matched.
Input: ('', 'anything')
Expected Output: True
Explanation: The empty string is a subsequence.
Input: ('abc','')
Expected Output: False
Explanation: A non-empty string is not a subsequence of empty t.
Hints
- Clarify edge cases before coding.
- Keep outputs deterministic when several valid answers exist.