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 121–150 of 187 results

  • StringsMediumAuto-graded
    Longest Uniform Stretch With a Swap Budget

    Tests efficient sliding-window reasoning to find the longest substring that can be made all one character using at most k single-character replacements.

    Stringssliding-windowstringsfrequency-counting
  • StringsMediumAuto-graded
    Case-Insensitive Substring Search Across a Music Catalog

    Tests ability to normalize user input and apply multi-field substring filtering across a collection of structured records.

    Stringsstringsfilteringcase-insensitive
  • StringsHardAuto-graded
    Sum Two Large Numbers Represented as Strings

    Tests whether a candidate can implement column-by-column addition with carry logic on digit strings, without converting the whole string to a native integer.

    Stringsstringsmath-bitssimulation
  • StringsEasyAuto-graded
    Process Sequential Variable Assignments

    Tests parsing and evaluating variable assignments in order, handling literals, references, and arithmetic expressions.

    Stringsparsingdictionaryexpression-evaluation
  • StringsEasyAuto-graded
    Total Palindrome Substrings in a String

    Tests your ability to count every palindromic substring by expanding around centers or applying Manacher's linear-time algorithm.

    Stringsstringsdynamic-programmingtwo-pointers
  • StringsEasyAuto-graded
    First Longest Window of Distinct Characters

    Tests whether a candidate can apply the sliding window technique with a hash map to find the earliest, longest non-repeating character run in a string.

    Stringssliding-windowhash-maptwo-pointers
  • StringsHardAuto-graded
    Minimum Prefix Extension to Form a Palindrome

    Tests whether you can use the KMP failure function to find the longest palindromic prefix of a string and prepend the minimum number of characters to make it a palindrome.

    Stringsstringskmppalindrome
  • StringsMediumAuto-graded
    Extract Stock Symbols from a Text Snippet

    Tests whole-word, case-insensitive multi-token matching with trie-based scanning and deduplication ordered by a reference list.

    Stringsstringshashingtrie
  • StringsMediumAuto-graded
    Widest Alphabetic Boundary Gap Across Tokens

    Tests string scanning, ASCII letter detection, and single-pass maximum tracking with tie handling across whitespace-delimited tokens.

    Stringsstringsscanningcase-normalizationties
  • StringsMediumAuto-graded
    Group Words by Character Frequency

    Tests hash map construction with canonical keys to partition strings by anagram equivalence

    Stringshash-mapsortingstring-manipulation
  • StringsMediumAuto-graded
    Longest Window of Unique Characters

    Tests whether a candidate can apply a sliding window with a character index map to find the longest contiguous run of non-repeating characters.

    Stringssliding-windowhash-maptwo-pointers
  • StringsMediumAuto-graded
    Total Palindrome Substring Count

    Tests the ability to efficiently enumerate all palindromic substrings using center expansion and handle both odd and even-length cases.

    Stringspalindromestwo-pointersstring-manipulation
  • StringsMediumAuto-graded
    Reconcile Payments with Invoices Using Memo and Amount

    Tests multi-pattern substring search, hash-based indexing, and greedy reconciliation with priority-based tie-breaking across two matching strategies.

    Stringsstring-matchinghash-mapgreedyaho-corasick
  • StringsMediumAuto-graded
    Build a Token Merger with Threshold-Based Pair Consolidation

    Tests implementation of a stateful tokenizer that learns merge operations by iteratively combining frequent adjacent pairs, then applies those rules to encode and decode text.

    Stringstokenizationgreedystate-management
  • StringsMediumAuto-graded
    Score Tasks From Event Log Strings

    Parse "id:command" log lines, accumulate weighted scores per task with a hash map, and keep only tasks that completed.

    Stringsstringshash-mapsimulationparsing
  • StringsMediumAuto-graded
    Count Sliding Windows Matching a Step-Direction Sequence

    Tests whether a candidate can reduce pairwise comparisons to a sign sequence and count all overlapping pattern matches in linear time using KMP.

    Stringsstring-matchingkmparrayssliding-window
  • StringsEasyAuto-graded
    Grid Walker: Did the Drone Return to Base?

    Tests whether a candidate can simulate 2D movement on a grid and determine if a sequence of directional steps nets zero displacement.

    Stringsstringssimulationmath-bits
  • StringsMediumAuto-graded
    Check Password Compliance and Report Violations

    Tests string validation logic, character classification, case-insensitive pattern matching, and consecutive character counting.

    Stringsvalidationstring-processingpattern-matching
  • StringsMediumAuto-graded
    Sliding Tokens: Valid String Transformation

    Tests two-pointer traversal, sequence invariants, and directional movement constraints with O(n) time and O(1) space.

    Stringstwo-pointersgreedyinvariants
  • StringsEasyAuto-graded
    Fixed-Width Substitution Cipher: Encode and Decode

    Tests your ability to apply character-to-code substitution and reverse it using an inverted dictionary for O(1) chunk lookups.

    Stringsstringshash-mapsimulation
  • StringsHardAuto-graded
    Group Anagram Chains by Transformation Distance

    Tests anagram grouping combined with string parsing and multi-key sorting to build and rank clusters of anagrammatically related words from a structured input.

    Stringsstringsanagram groupingsortingparsing
  • StringsMediumAuto-graded
    Highest Frequency Letter with Alphabetical Tie-Breaking

    Tests efficient character frequency counting and consistent tie-breaking using fixed-size auxiliary space.

    Stringsstringsarraysfrequency-counting
  • StringsMediumAuto-graded
    Fix a Row-to-CSV Converter: Output Correctness and Efficiency

    Tests whether a candidate can spot a trailing-comma output bug and a quadratic string-building performance problem, then write a correct, efficient fix.

    Stringsstringsperformancejoins
  • StringsMediumAuto-graded
    Text Substitution with Whole-Word Match and Longest-Prefix Priority

    Apply a phrase-to-replacement map on the original text in one pass, respecting whole-word boundaries and preferring longer matches.

    Stringstriegreedystring-matching
  • StringsEasyAuto-graded
    Scale Serving Sizes in a Shopping List

    Tests careful string parsing: multiply only the leading numeric token in each line while leaving the rest of the text exactly as-is.

    Stringsstringsparsinglist manipulation
  • StringsHardAuto-graded
    Detect a Contiguous Block Inside an Integer Sequence

    Tests the ability to determine whether one integer array appears as an unbroken, in-order block inside a larger array using linear-time pattern matching.

    StringsKMPpattern matchingarrayssubsequence
  • StringsHardAuto-graded
    Find Next Larger Palindrome Within Digit Limit

    Tests constructing the immediate successor palindrome by manipulating the left half, handling carries, length transitions, and an upper bound.

    Stringspalindromesstring-manipulationgreedy
  • StringsMediumAuto-graded
    Character Removal Anagram Matching

    Tests string manipulation and character frequency analysis to determine if two strings can become anagrams through optional single-character removal.

    Stringshash-mapcountinganagrams
  • StringsMediumAuto-graded
    Maximum Unique Character Window Length

    Tests sliding window technique with hash map indexing to efficiently find the longest substring with all distinct characters.

    Stringssliding-windowhash-maptwo-pointers
  • StringsMediumAuto-graded
    Minimum Edits to Make a String k-Palindromic

    Tests the ability to combine classic edit-distance dynamic programming with palindrome structure to find the minimum single-character substitutions needed to make a string palindromic after removing exactly k characters.

    Stringsstringsdynamic-programmingedit-operations