FastPrepRepeated DNA Sequences
Problems/Repeated DNA Sequences

Repeated DNA Sequences

NVIDIA logoNVIDIA● MediumFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in an NVIDIA phone screen for a full-time role. The report names the standard repeated DNA problem. It leaves out the detailed statement and the exact corner-case follow-ups. We chose lexicographic output order, what happens for empty input, and the input size limit.

Our version is about 95% the same as the reported question.

Given a DNA string s containing only A, C, G and T, return every distinct contiguous substring of exactly 10 characters that appears at least twice.

  • Occurrences at different starting positions count separately, even when they overlap.
  • Return each repeated substring exactly once, in ascending lexicographic order using A < C < G < T.
  • Match the characters exactly. Reversed strings and reverse complements are not equivalent.
  • If no substring repeats, including when s.length < 10, return an empty array.

Interview context

This is the standard repeated DNA sequence exercise, with follow-ups on corner cases, time complexity and space complexity.

Explain the time and auxiliary space of your solution, including how many different windows it stores and any work used to order the result.

Function

findRepeatedDnaSequences(s: String) → List<String>

Examples

Example 1

s = "ACGTACGTACGTACGT"return = ["ACGTACGTAC","CGTACGTACG","GTACGTACGT"]

The windows starting at 0, 1 and 2 reappear at 4, 5 and 6. The window at 3 appears once.

Example 2

s = "TTTTTTTTTTT"return = ["TTTTTTTTTT"]

The two length-10 windows begin at 0 and 1. They overlap and have identical text, so the result contains that text once.

Example 3

s = "ACGT"return = []

The string is shorter than 10, so it has no complete window.

Constraints

  • 0 <= s.length <= 2000.
  • Every character of s is one of A, C, G or T.

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

  • Longest Substring Without Repeating CharactersAngel One · PHONE SCREEN
  • Longest Substring Without Repeating CharactersNykaa · PHONE SCREENNykaa interview questions
  • Longest Substring Without Repeating CharactersIBM · PHONE SCREENIBM interview questions
  • Longest Substring Without Repeating CharactersTikTok · PHONE SCREENTikTok interview questions
  • Find Word-Multiset WindowsAmazon · PHONE SCREEN
  • Find the First Contiguous HaikuFaire · PHONE SCREEN
  • Longest Substring Without Repeating CharactersCapgemini · PHONE SCREENCapgemini interview questions
  • Longest Substring Without Repeating CharactersWex · PHONE SCREEN
  • Minimum Window of Required WordsSalesforce · PHONE SCREENSalesforce interview questions
  • Longest Substring Without Repeating CharactersRedNote · PHONE SCREEN

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 List<String> findRepeatedDnaSequences(String s) {
        // Write your code here.
    }

}
Checking account…