practice a little every day — you've got this ♡
Strings Interview Problems
Practice 5966 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.
- 5966
- Problems
- 2209
- Auto-graded
- 15
- Topics
- 271
- Added today
Showing 31–60 of 227 results
- StringsEasyAuto-gradedKeypad Digit Prefix Word Lookup
Encode words as keypad digit strings and answer many digit-prefix queries quickly using sorted ranges or a trie, returning matches in alphabetical order.
Stringsbinary-searchprefixsortingtrie - StringsMediumAuto-gradedFewest Front-Relocations to Rearrange a String
Count 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.
Stringsstringsgreedytwo-pointerssubsequence - StringsMediumAuto-gradedString Array Framing and Round-Trip Encoding
Design a robust serialization scheme that packs a list of arbitrary strings into a single string and successfully reconstructs it without ambiguity.
Stringsstringsarraysdesign-ds - StringsMediumModel answerDefine and Implement a Streaming Unicode Word Counter
Specify 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.
Stringstokenizationunicodestreamingstate-machine - StringsMediumAuto-gradedSplit Text by Longest Dictionary Prefix with Single-Char Fallback
Scan 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.
Stringstriegreedystring-processingprefix-matching - StringsMediumModel answerBuild a Streaming Lisp-Style Expression Reader with Exact Error Positions
Write 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.
Stringsparsingrecursive-descenterror-handlings-expression - StringsMediumAuto-gradedTally Slices Whose Letters Are All Different
Count every contiguous slice of a lowercase string in which no letter appears twice, using a linear-time sliding window.
Stringssliding-windowtwo-pointersstringscounting - StringsMediumAuto-gradedRolling Up Page Views Through Hostname Suffixes
Aggregate 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.
Stringshash-mapstringsparsingsuffix-enumeration - StringsEasyAuto-gradedEncode Keypad Multi-Tap Strokes
Simulate telephone keypad multi-tap text encoding while inserting pause delimiters for consecutive letters on the same digit key.
Stringsstringshash-tablesimulation - StringsMediumAuto-gradedValidate a Plain Signed Decimal Literal
Check 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.
Stringsstringsparsingvalidationedge-cases - StringsEasyAuto-gradedReassemble Framed Messages from Chunked Byte Streams
Join 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.
Stringsbyte-streamparsingframingbuffering - StringsMediumAuto-gradedEvaluate a Nested Let/Add/Mult Expression, or Report Invalid
Tokenize, validate and evaluate a small Lisp-like language with scoped let bindings, returning None for any malformed or ill-formed input.
Stringsparsingrecursionscopestring-processing - StringsMediumAuto-gradedMax Overlap of String Suffix and Prefix
Find the maximum length of a suffix of one string that matches a prefix of another.
Stringsstringskmpprefix-functiontwo-pointers - StringsEasyAuto-gradedStitch Glyph Rows Into a Banner
Combine per-character row strings from a font table into banner lines by joining row i of every glyph in order.
Stringsstringssimulationhash-mapjoin - StringsMediumAuto-gradedEvaluate Arithmetic String Without Parentheses
Parse and compute a non-negative integer arithmetic string with basic binary operators while preserving standard precedence and left-to-right evaluation.
Stringsstringsparsingstacks-queuesmath-bits - StringsEasyAuto-gradedFind the First Near-Match Code With Optional Folding Rules
Scan 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.
Stringsstringshamming-distancenormalizationsimulation - StringsMediumAuto-gradedLeftmost Longest Mirror-Reading Substring
Find the longest contiguous substring that reads the same in both directions, returning the leftmost one on ties; tests center expansion or Manacher-style reasoning.
Stringsstringspalindrometwo-pointersmanacher - StringsMediumAuto-gradedShared-Letter Splits and Best Uniform Bundles
Count 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.
Stringsstringshash-mapcountingprefix-suffix - StringsMediumAuto-gradedExpand a Compact Letter-and-Count String
Parse 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.
Stringsstring-parsingtwo-pointerssimulationrun-length-encoding - StringsMediumAuto-gradedFill Placeholders in a Chained Request Template
Recursively resolve {{dotted.path}} placeholders in a nested request, keeping native types for whole-string matches and stringifying embedded ones.
Stringsrecursionregexjsontemplate-substitution - StringsEasyAuto-gradedRearrangement Check Using Letter Tallies, No Sorting
Decide whether two lowercase strings are rearrangements of each other using letter frequency counting in linear time, without sorting.
Stringsstringshash-tablefrequency-countanagram - StringsMediumAuto-gradedCorridor Run With Matching Keys and Locked Doors
Find the fewest moves along a 1D corridor with walls, keys and doors, and notice that the state space collapses to a simple prefix scan.
Stringsbfsbitmaskstring-scanstate-space - StringsMediumAuto-gradedLongest Unique Sequence of Media Titles
Find the maximum length of a contiguous subsequence of string titles containing no duplicated elements using a dynamic sliding window approach.
Stringssliding-windowhash-tablestringsarrays - StringsMediumAuto-gradedReconstruct IPv4 Addresses from Digit Sequence
Parse a string of numeric digits into all possible valid four-part IPv4 address representations.
Stringsstringsbacktrackingparsing - StringsMediumAuto-gradedCompressed Word Check Plus Bracket Matching
Tests two linear scans in one function: validating a numeric-skip word abbreviation with two pointers, and checking nested bracket balance with a stack.
Stringstwo-pointersstackstring-parsingvalidation - StringsMediumAuto-gradedOrder Distinct Letters-Only Tokens by Popularity
Extract case-insensitive ASCII-letter tokens from text, count them, and list the distinct words by descending count with alphabetical tie-breaks.
Stringshash-mapstring-parsingsortingfrequency-count - StringsMediumModel answerStream Data Processing with Early Cutoff on Sequence Detection
Yield data from a continuous stream of string fragments, terminating immediately when a specific multi-character sequence is identified across fragment boundaries.
Stringsstringssliding-windowtwo-pointerskmp - StringsEasyAuto-gradedName the CSS Function for Red-Green-Blue With Optional Alpha
Recall which CSS color function takes red, green and blue channels plus an optional opacity value, and return its canonical name as a string.
Stringscssfundamentalstriviastring-return - StringsMediumAuto-gradedDoes This Shorthand Describe the Word?
Check 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.
Stringstwo-pointersstring-parsingsimulation - StringsEasyModel answerRound Decimal Strings to a Power-of-Ten Step, No Floats
Round 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.
Stringsstringsroundingbig-numberscarry