Repeated DNA Sequences
Solve this the way you would in the interview: out loud, on a timer, with an AI interviewer asking follow-ups while you code. You get a scored report at the end.
Practice this as a mock interviewFree to start, no account neededProblem
A DNA strand is a string over the letters 'A', 'C', 'G' and 'T'. Given a strand s, find every sequence of exactly **10 letters** that appears as a substring of s at least twice. Occurrences may overlap.
Return the qualifying sequences **sorted in ascending lexicographic order**, each listed once. Return an empty list if there are none.
Examples
Constraints
- 0 <= s.length <= 10^5
- `s[i]` is one of 'A', 'C', 'G', 'T'.
What the interviewer grades
A correct solution is one of five scores. The report also grades problem understanding (did you clarify inputs and edge cases before coding), problem solving, communication while you work, code quality, and testing. See a sample report, or read up on the pattern in the lessons.