Topic
Strings interview problems
Parsing, matching, palindromes and string transforms. 227 original problems, each with hidden test cases you can run in the browser.
60 easy154 medium13 hard
Showing 31–60 of 227 results
Encode words as keypad digit strings and answer many digit-prefix queries quickly using sorted ranges or a trie, returning matches in alphabetical order.
Auto-gradedbinary-searchprefixsortingtrieCount the minimum moves to turn one string into another by moving characters to the front, using a multiset check and a right-to-left greedy subsequence match.
Auto-gradedstringsgreedytwo-pointerssubsequenceDesign a robust serialization scheme that packs a list of arbitrary strings into a single string and successfully reconstructs it without ambiguity.
Auto-gradedstringsarraysdesign-dsSpecify precise tokenization rules for counting words in text, then build a Unicode-aware counter that works on huge streams, with tests and a regex versus scanner comparison.
Model answertokenizationunicodestreamingstate-machineScan a string left to right, always consuming the longest dictionary word starting at the current position, or one character if none match; tests tries and prefix matching.
Auto-gradedtriegreedystring-processingprefix-matchingWrite a single-pass reader for a small Lisp-like syntax with integers, symbols and nested lists, reporting the first error with a clear message and exact character index.
Model answerparsingrecursive-descenterror-handlings-expressionCount every contiguous slice of a lowercase string in which no letter appears twice, using a linear-time sliding window.
Auto-gradedsliding-windowtwo-pointersstringscountingAggregate per-host view counts so every host and each of its parent suffixes gets the total of itself and all hosts beneath it, using suffix enumeration and a hash map.
Auto-gradedhash-mapstringsparsingsuffix-enumerationSimulate telephone keypad multi-tap text encoding while inserting pause delimiters for consecutive letters on the same digit key.
Auto-gradedstringshash-tablesimulationCheck whether a string is a well-formed plain decimal literal (optional sign, digits, optional fraction) by turning a small grammar into a careful single-pass validator.
Auto-gradedstringsparsingvalidationedge-casesJoin byte chunks from a simulated stream and split them into complete messages, using either a 4-byte length prefix or newline delimiters, while ignoring any incomplete tail.
Auto-gradedbyte-streamparsingframingbufferingTokenize, validate and evaluate a small Lisp-like language with scoped let bindings, returning None for any malformed or ill-formed input.
Auto-gradedparsingrecursionscopestring-processingFind the maximum length of a suffix of one string that matches a prefix of another.
Auto-gradedstringskmpprefix-functiontwo-pointersCombine per-character row strings from a font table into banner lines by joining row i of every glyph in order.
Auto-gradedstringssimulationhash-mapjoinParse and compute a non-negative integer arithmetic string with basic binary operators while preserving standard precedence and left-to-right evaluation.
Auto-gradedstringsparsingstacks-queuesmath-bitsScan candidate codes in order and return the first whose normalized form is within a mismatch limit of a reference, using optional case folding and O/0, I/1 merging.
Auto-gradedstringshamming-distancenormalizationsimulationFind the longest contiguous substring that reads the same in both directions, returning the leftmost one on ties; tests center expansion or Manacher-style reasoning.
Auto-gradedstringspalindrometwo-pointersmanacherCount string split points whose halves share more than k distinct characters, and find the most equal-total bundles of one or two items from a cost list, with a special rule for zero-cost items.
Auto-gradedstringshash-mapcountingprefix-suffixParse a string of letters with optional multi-digit repeat counts, treating a missing count as one, and rebuild the expanded text in a single left-to-right pass.
Auto-gradedstring-parsingtwo-pointerssimulationrun-length-encodingRecursively resolve {{dotted.path}} placeholders in a nested request, keeping native types for whole-string matches and stringifying embedded ones.
Auto-gradedrecursionregexjsontemplate-substitutionDecide whether two lowercase strings are rearrangements of each other using letter frequency counting in linear time, without sorting.
Auto-gradedstringshash-tablefrequency-countanagramFind the fewest moves along a 1D corridor with walls, keys and doors, and notice that the state space collapses to a simple prefix scan.
Auto-gradedbfsbitmaskstring-scanstate-spaceFind the maximum length of a contiguous subsequence of string titles containing no duplicated elements using a dynamic sliding window approach.
Auto-gradedsliding-windowhash-tablestringsarraysParse a string of numeric digits into all possible valid four-part IPv4 address representations.
Auto-gradedstringsbacktrackingparsingTests two linear scans in one function: validating a numeric-skip word abbreviation with two pointers, and checking nested bracket balance with a stack.
Auto-gradedtwo-pointersstackstring-parsingvalidationExtract case-insensitive ASCII-letter tokens from text, count them, and list the distinct words by descending count with alphabetical tie-breaks.
Auto-gradedhash-mapstring-parsingsortingfrequency-countYield data from a continuous stream of string fragments, terminating immediately when a specific multi-character sequence is identified across fragment boundaries.
Model answerstringssliding-windowtwo-pointerskmpRecall which CSS color function takes red, green and blue channels plus an optional opacity value, and return its canonical name as a string.
Auto-gradedcssfundamentalstriviastring-returnCheck whether a shorthand of letters and skip counts exactly describes a word, handling multi-digit counts, leading zeros, overruns and leftover characters with a two-pointer scan.
Auto-gradedtwo-pointersstring-parsingsimulationRound a decimal string to the nearest integer, then to a power-of-ten step such as 100 or 0.1, using only string and digit operations and a clearly stated tie-breaking rule.
Model answerstringsroundingbig-numberscarry