KatInterview

practice a little every day — you've got this ♡

Strings Interview Problems

Practice 5972 original coding, SQL, system design, machine learning and behavioral problems across 15 topics. Coding and SQL problems run against hidden test cases right in your browser; every problem has hints and a worked solution, free.

5972
Problems
2212
Auto-graded
15
Topics
273
Added today

Showing 91–120 of 187 results

  • StringsMediumAuto-graded
    Build an expression from 1 to 9 that hits a target

    Tests depth-first backtracking over operator choices, on-the-fly evaluation without re-parsing, and deterministic tie-breaking when several valid answers exist.

    Stringsbacktrackingdfsrecursionstring-construction
  • StringsMediumAuto-graded
    Longest Repeat-Free Concatenation, Lexicographically Smallest

    Pick words and order them to form the longest string with no repeated character, breaking ties by smallest lexicographic order; tests subset backtracking with disjoint-set pruning.

    Stringsbacktrackingsubsetsstringsbitmask
  • StringsMediumAuto-graded
    Locate the First Occurrence of a Needle in a Haystack

    Find the earliest starting index of a pattern inside a text in linear time, handling empty inputs and repetitive patterns, using a prefix-function (KMP-style) scan.

    Stringsstringskmptwo-pointerspattern-matching
  • StringsEasyAuto-graded
    Tally Clean Tokens in a Space-Delimited Line

    Split a line on spaces and count the tokens made only of ASCII letters and the marks , . ? !, testing exact tokenization and character-class checks.

    Stringsstringsparsingtokenizationhash-set
  • StringsMediumAuto-graded
    Fewest Edits to a Repeating Palindromic Pattern

    Find the minimum character edits so a string becomes both a palindrome and a repetition of a length-k block, by grouping positions into forced-equal classes.

    Stringsstringspalindromeperiodicityequivalence-classes
  • StringsEasyAuto-graded
    Tab-Scoped Ticket Search with Case-Insensitive Matching

    Filter support tickets by tab, then by a case-insensitive substring match on title or assignee, handling blank queries and unassigned tickets.

    Stringsstringsfilteringcase-insensitivesimulation
  • StringsMediumAuto-graded
    Longest Repeated-Letter Block With a Limited Rewrite Budget

    Find the longest block of identical letters obtainable by rewriting at most k characters, testing sliding-window reasoning on majority counts for strings up to 100,000 characters.

    Stringssliding-windowstringstwo-pointershashing
  • StringsMediumAuto-graded
    Interleave Characters from String Ends

    Rebuild a string by alternately picking characters from opposite ends until all are consumed, testing two-pointer convergence logic.

    Stringstwo-pointersstring-manipulationarray
  • StringsMediumAuto-graded
    Count Character Mismatches Across All Palindrome Mirrors

    Tests the ability to reframe a quadratic substring enumeration into a pair-centric counting problem with geometric weight calculations.

    Stringscombinatoricsstring-algorithmsoptimization
  • StringsEasyAuto-graded
    Convert Integer to English Words

    Tests ability to decompose integers into groups and translate numeric values into properly formatted English text with correct scaling terms.

    Stringsrecursionmathstring-formatting
  • StringsMediumAuto-graded
    Words Buildable from Two Different Entries in a Set

    Use a hash set to test every split point of each word, reporting words formable as two distinct list entries, sorted.

    Stringshash-setstringssortingenumeration
  • StringsMediumAuto-graded
    Find All Pattern Positions in Text

    Tests implementation of efficient string matching and understanding of linear-time pattern search algorithms.

    Stringsstring-matchingkmppattern-search
  • StringsMediumAuto-graded
    Minimum Window Containing All Required Characters

    Tests sliding window technique with character frequency tracking to find the smallest substring that satisfies multiplicity constraints.

    Stringssliding-windowtwo-pointershash-map
  • StringsMediumAuto-graded
    Parse and Validate Business Registration CSV Records

    Tests multi-rule sequential validation over CSV rows: field presence, tax ID format normalization, and fuzzy owner name matching via token overlap.

    Stringsstringsparsingvalidation
  • StringsMediumAuto-graded
    Count Balanced Two-Block Substrings in a Binary String

    Tests whether a candidate can group consecutive identical characters into runs and use adjacent run lengths to efficiently count valid balanced substrings.

    Stringsstringstwo-pointersrun-length-encoding
  • StringsMediumAuto-graded
    Letter Tile Scorer for a Word-Guessing Game

    Tests whether you can implement a precise per-letter color-scoring rule — including count-limited yellow matching — across a list of guesses against a fixed target word.

    Stringsstringsarrayshashing
  • StringsMediumAuto-graded
    Reversible String List Serializer

    Tests whether a candidate can design a lossless encode/decode round-trip for arbitrary strings without relying on a fixed delimiter character.

    Stringsstringsserializationencoding
  • StringsHardAuto-graded
    Encode Consecutive Character Runs as Digit Sequences

    Tests run-length encoding with multi-digit counts split into individual characters, requiring careful pointer management and constant-space thinking.

    Stringstwo-pointersrun-length-encodingin-place
  • StringsMediumAuto-graded
    Multiply Large Numbers as Strings

    Tests implementation of grade-school multiplication on arbitrarily large integers represented as strings without using built-in big integer operations.

    Stringsmathsimulationarray-manipulation
  • StringsMediumAuto-graded
    First Window Matching a Letter-Frequency Snapshot

    Tests fixed-size sliding window technique with O(1) per-step character-count bookkeeping to locate the leftmost permutation of a pattern inside a longer string.

    Stringssliding-windowhash-maptwo-pointers
  • StringsEasyAuto-graded
    Cluster Words by Letter Inventory

    Tests whether you can use a canonical character-frequency key and a hash map to partition a list of strings into anagram groups in linear time.

    Stringshash-mapstringsanagrams
  • StringsEasyAuto-graded
    Count Single-Character Occurrences in a String

    Tests whether a candidate can scan a string and tally exact, case-sensitive matches for a given character, including edge cases like empty input and repeated characters.

    Stringsstringscountingcase-sensitivity
  • StringsMediumAuto-graded
    Reconstruct Digit Sequence from a Jumbled Letter Pool

    Tests whether a candidate can decode digit counts from a scrambled multiset of English number-word letters using systematic letter-frequency elimination.

    Stringsstringshash-mapgreedy-intervals
  • StringsMediumAuto-graded
    Build All Balanced Bracket Sequences

    Tests recursion with constraint-based pruning to construct valid nested bracket strings without generating invalid candidates.

    Stringsrecursionbacktrackingcombinatorics
  • StringsMediumAuto-graded
    Longest Shared Leading-Digit Sequence Between Two Integer Lists

    Tests whether a candidate can avoid brute-force pair comparison by exploiting bounded digit counts to match prefixes efficiently with a hash set.

    Stringsstringsarrayshashing
  • StringsMediumAuto-graded
    Sum Two Large Numbers Represented as Digit Strings

    Tests manual digit-by-digit addition with carry propagation on arbitrarily large integers stored as strings.

    Stringsstring-manipulationmathsimulation
  • StringsMediumAuto-graded
    Check Character Mapping Consistency

    Tests whether two strings establish a valid one-to-one character correspondence at each position.

    Stringshash-maptwo-pointersbijection
  • StringsMediumAuto-graded
    Minimum Edits to Form Palindromic Segments

    Tests two-pointer logic and palindrome verification to compute the fewest replacements that transform every fixed-size segment into a palindrome.

    Stringstwo-pointerspalindromegreedy
  • StringsMediumAuto-graded
    Verify Anagram Coverage for All Contiguous Substrings

    Tests whether every contiguous substring of length 3 or more in a given string can be rearranged to match some dictionary word.

    Stringsanagramsprefix-sumhashing
  • StringsEasyAuto-graded
    Arrange Garment Sizes in Standard Order

    Tests understanding of counting sort for a fixed alphabet, achieving linear time complexity instead of comparison-based sorting.

    Stringscounting-sortstring-manipulationlinear-time