FastPrepCheck Ordered Letter Containment
Problems/Check Ordered Letter Containment

Check Ordered Letter Containment

NVIDIA logoNVIDIA● EasyFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The report describes ordered matching and a two-pointer approach, but omits repeated-letter, alphabet, bound and empty-input rules. This version uses separate occurrences in increasing positions and matches the reported core at about 90%.

Given two strings s and t, return true if all character occurrences of s can be selected from t in the same order. Otherwise, return false.

For this exercise, assume each character occurrence of s must match a different position in t. The selected target positions must be strictly increasing. You may skip other characters of t; the selected positions do not have to be consecutive.

For this exercise, the empty string is contained in every target, including an empty target. A nonempty s is not contained in an empty t.

Function

containsOrderedLetters(s: String, t: String) → boolean

Examples

Example 1

s = "abc"t = "axbzyc"return = true

The characters at indices 0, 2 and 5 of t form abc. Other characters may be skipped.

Example 2

s = "acb"t = "abc"return = false

After matching a and c, no b remains to their right. Having all distinct letters is insufficient.

Example 3

s = "aa"t = "a"return = false

The two occurrences of a in s need two different positions in t.

Constraints

  • For this exercise, assume 0 <= s.length, t.length <= 1000.
  • For this exercise, both strings contain only lowercase English letters a through z.

More NVIDIA Phone Screen questions

  • Network Layer Execution OrderPHONE SCREEN · Seen Nov 2026
  • Paged KV Cache AccessPHONE SCREEN · Seen Nov 2026
  • Sliding Window Attention over a KV CachePHONE SCREEN · Seen Nov 2026
  • Summarize Server Healthcheck LogsPHONE SCREEN · Seen Oct 2026
  • Hash Partition OffsetsPHONE SCREEN · Seen Oct 2026
  • Filter Paginated Medical RecordsPHONE SCREEN · Seen Oct 2026
  • Least Frequently Used CachePHONE SCREEN · Seen Oct 2026
  • Parallel String Counts with a Custom Hash TablePHONE SCREEN · Seen Oct 2026
  • Simulate a Reference-Counted Smart PointerPHONE SCREEN · Seen Aug 2026
  • Streaming Top-K Frequent ElementsPHONE SCREEN · Seen Aug 2026

Similar questions at other companies

  • Run-Length Encoding and DecodingAirbnb · PHONE SCREENAirbnb interview questions
  • Check if a String Is a PalindromeCisco · PHONE SCREENCisco interview questions
  • Halfway Course in a Single TrackCrunchyroll · PHONE SCREENCrunchyroll interview questions
  • Reverse a StringAmazon · PHONE SCREEN
  • Reverse a String ManuallyNewgen Software · PHONE SCREEN
  • Reverse a String with Two PointersSnowflake · PHONE SCREENSnowflake interview questions
  • Palindrome with One DeletionWhatNot · PHONE SCREENWhatNot interview questions
  • Valid Word AbbreviationMeta · PHONE SCREENMeta interview questions
  • Reverse a StringPersistent Systems · PHONE SCREEN
  • Minimum Changes for Palindromic BlocksCitadel · OA · PHONE SCREEN · ONSITE INTERVIEWCitadel interview questions

NVIDIA interview experiences

  • NVIDIA Full-Time SWE Onsite Scheduling: 1 Experience
  • NVIDIA OA: What It Tests (2026)
  • NVIDIA DevOps, QA and Infra Intern Interviews: 12 Experiences
  • NVIDIA Ignite Internship OA Experience
  • NVIDIA Software Intern Interview Questions: 9 Experiences
  • NVIDIA Ignite SWE Intern OA Questions: 6 Experiences
All NVIDIA interview questionsSee NVIDIA hiring insights
Saved
class Solution {
    public boolean containsOrderedLetters(String s, String t) {
        // Return whether t satisfies the required letter matching.
    }
}
Checking account…