FastPrepCheck a Repeated String as a Subsequence
Problems/Check a Repeated String as a Subsequence

Check a Repeated String as a Subsequence

Quince logoQuince● EasyNEW GRADOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a Quince new grad online assessment. The report does not give the exact shape of the return value or the number limits. Our version is about 93% the same as the reported question.

Given two nonempty strings str1 and str2 and a positive integer k, consider the string formed by concatenating str2 with itself exactly k times.

You may delete any characters from str1 without changing the relative order of the remaining characters.

Return true if the repeated string is a subsequence of str1. Otherwise, return false.

Function

isRepeatedSubsequence(str1: String, str2: String, k: int) → boolean

Examples

Example 1

str1 = "abcabcabc"str2 = "abc"k = 2return = true

The first six characters of str1 form abcabc, which is str2 repeated twice.

Example 2

str1 = "abacb"str2 = "abc"k = 2return = false

The required repeated string has six characters, but str1 has only five characters, so it cannot be a subsequence.

Example 3

str1 = "axbyacbz"str2 = "ab"k = 2return = true

Keeping the characters at positions 0, 2, 4, and 6 produces abab.

Constraints

  • 1 <= str1.length, str2.length <= 100000
  • 1 <= k <= 100000
  • str1 and str2 contain only lowercase English letters.

More Quince interview questions

  • Minimum Sprinklers to Cover an IntervalOA · Seen Aug 2026
  • Meeting Rooms IIPHONE SCREEN · Seen Oct 2026

Similar questions at other companies

  • Rearrange String by Alternating EndsHudson River Trading · OAHudson River Trading interview questions
  • Alternate String EndsCapital One · OACapital One interview questions
  • Run-Length String CompressionSalesforce · OASalesforce interview questions
  • Minimum Changes for Palindromic BlocksCitadel · OA · PHONE SCREEN · ONSITE INTERVIEWCitadel interview questions
  • Count Binary SubstringsMicrosoft · OAMicrosoft interview questions
  • Reverse String In PlaceThe Walt Disney Company · OA · PHONE SCREENThe Walt Disney Company interview questions
  • Lost MessagesSuperhuman · OASuperhuman interview questions
  • Reverse a StringFlexTrade · OAFlexTrade interview questions
  • Missing WordsVanguard · OAVanguard interview questions
  • Reverse the Interior of Vowel-Bounded WordsVisa · OAVisa interview questions
All Quince interview questionsSee Quince hiring insights
Saved
class Solution {
    public boolean isRepeatedSubsequence(String str1, String str2, int k) {
      // write your code here
    }
}
Checking account…