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 1–30 of 227 results
Find the lexicographically greatest suffix of a long lowercase string in linear time by comparing candidate start positions without copying and skipping eliminated blocks.
Auto-gradedstringstwo-pointersgreedysuffixScan a list of 0/1/? templates, keep those that fit a bit string, and return the one with the fewest wildcards, breaking ties by earliest position.
Auto-gradedstringspattern-matchinglinear-scantie-breakingParse a URL query string by hand, then greedily wrap the text to a width and fix a lone last-line word by borrowing from the previous line.
Auto-gradedstring-parsinggreedysimulationtext-wrappingFind the length of the longest contiguous stretch of a string using no more than k different characters, testing the sliding-window technique with a frequency map.
Auto-gradedsliding-windowtwo-pointershash-mapstringsDetermine whether a given string can be converted into a palindrome by removing no more than one character.
Auto-gradedstringstwo-pointersParse an English number phrase (up to millions, optional "negative" prefix) into its integer value using a single left-to-right pass with group accumulators.
Auto-gradedstring-parsingtokenizationhash-mapsimulationValidate access-log lines field by field, then count client errors, server errors, invalid lines and the failure percentage over the valid lines only.
Auto-gradedstringsparsingvalidationsimulationCount letter frequencies in two equal-length strings to find the fewest in-place letter replacements that make the second string an anagram of the first.
Auto-gradedstringshash-mapfrequency-countinganagramCheck whether a string is a palindrome when only letters and digits count and case is ignored, using two pointers with constant extra space.
Auto-gradedtwo-pointersstringspalindromeCompute, for each word, the shortest leading substring shared with no other entry, using prefix counting or a trie, and return the whole word when none exists.
Auto-gradedtrieprefixhash-mapstringsBuild a small browser widget that scores a typed guess of up to five letters against a fixed secret word, marking each letter exact, misplaced or absent, with sound input handling.
Model answerstringsfrontendstate-managementinput-validationFind all dictionary words that fit a key trace as a start- and end-anchored subsequence where letters may reuse a key, using a next-occurrence table to match many words efficiently.
Auto-gradedstringssubsequencegreedyprecomputationExpand %NAME% placeholders whose values may reference other placeholders, handling %% escapes, missing names, and circular references.
Auto-gradedparsingdfsmemoizationcycle-detectionDescribe how a string is laid out in memory, what copying and moving really cost, what a Rust move does, and how OS threads differ from async coroutines.
Model answerstringsmemory-managementmove-semanticsrustFind the first second at which at least m substrings of a string contain a corrupted character, using complement counting and a reverse-time merge of clean runs.
Auto-gradedstringsunion-findcountingreverse-simulationFind the shortest contiguous piece of a text that includes all letters of a target, with repeats and case mattering, using a sliding window with counts and earliest-start tie-breaking.
Auto-gradedsliding-windowtwo-pointershash-mapstringsCount how often each character occurs in a string and report the tallies in the order the characters first appear, treating every character as distinct and significant.
Auto-gradedhash-mapstringcountingordered-dictConvert clock strings to minutes and find the shortest wrap-around gap back to a past departure, covering unsorted input, duplicates and an empty schedule.
Auto-gradedtime-parsingmodular-arithmeticwrap-aroundlinear-scanTests a sliding window with last-seen indices plus a frequency count to find the longest repeat-free substring and the earliest character occurring exactly once.
Auto-gradedsliding-windowhash-mapstringsfrequency-countDetermine whether an initial 1D board configuration can reach a target configuration based on specific movement and jump rules.
Model answerstringstwo-pointersinvariantsExplain how JavaScript's two equality operators work, how implicit type coercion drives loose equality, where results diverge, and which operator to prefer.
Model answerjavascripttype-coercionequalitylanguage-fundamentalsDetermine which words from a dictionary can yield a target string by expanding consecutive duplicate characters in place.
Auto-gradedstringstwo-pointersarraysFind, for each string, its shortest substring that occurs in no other string (case-insensitive), with leftmost tie-break, and wrap it in brackets while keeping original casing.
Auto-gradedstringshash-mapsubstringsbitmaskFind the longest contiguous segment of a string that reads identically in both directions, preferring the leftmost one on ties and returning an empty string for empty input.
Auto-gradedstringspalindromeexpand-around-centertwo-pointersFind the length of the longest contiguous block of a string with no repeated character, using a linear-time sliding window with exact, case-sensitive comparison.
Auto-gradedsliding-windowhash-maptwo-pointersstringsCount substrings of a binary string made of one block of equal characters followed by a block of the other character, with both blocks the same length.
Auto-gradedstringstwo-pointersrun-lengthcountingFind the longest contiguous stretch of a string containing at most two different characters, testing the sliding window technique with a frequency map.
Auto-gradedsliding-windowhash-maptwo-pointersstringsDetermine the longest initial substring shared across every word in a given list.
Auto-gradedstringsarraysprefixFilter strings by a character and length rule, an issuer-prefix range and the Luhn checksum, returning the original text of each valid entry in input order.
Auto-gradedstringsvalidationluhnsimulationRound a decimal number given as a string to the nearest integer, then to its last significant digit, using digit-level arithmetic and carry handling instead of floating-point types.
Model answerstringscarry-propagationroundingparsing