KatInterview

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

Strings Interview Problems

Practice 5967 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.

5967
Problems
2210
Auto-graded
15
Topics
272
Added today

Showing 1–30 of 41 results

  • StringsEasyModel answer
    Letter-Match Feedback Widget for a Five-Letter Word Game

    Build 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.

    Stringsstringsfrontendstate-managementinput-validation
  • StringsMediumModel answer
    String Internals, Move Costs, and Threads vs Async Tasks

    Describe 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.

    Stringsstringsmemory-managementmove-semanticsrust
  • StringsMediumModel answer
    Verify Validity of Piece Movement on a 1D Board

    Determine whether an initial 1D board configuration can reach a target configuration based on specific movement and jump rules.

    Stringsstringstwo-pointersinvariants
  • StringsMediumModel answer
    JavaScript Strict vs Loose Equality: Coercion Rules and Pitfalls

    Explain how JavaScript's two equality operators work, how implicit type coercion drives loose equality, where results diverge, and which operator to prefer.

    Stringsjavascripttype-coercionequalitylanguage-fundamentals
  • StringsMediumModel answer
    Round a Decimal String Without Using Floats

    Round 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.

    Stringsstringscarry-propagationroundingparsing
  • StringsMediumModel answer
    Define 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
  • StringsMediumModel answer
    Build 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
  • StringsMediumModel answer
    Stream 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
  • StringsEasyModel answer
    Round 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
  • StringsMediumModel answer
    Java Code Review: Refactoring a CSV Generator

    Analyze a poorly designed Java method for generating CSV strings and detail performance, RFC 4180 compliance, memory usage, and security enhancements.

    Stringscode-reviewjavastringscsv
  • StringsMediumModel answer
    Filter Words Reachable From a Target by One Character Swap

    Given a target string and a list of words, return every word that becomes the target after swapping at most one pair of characters in that word, keeping input order.

    Stringsstringstwo-pointerscharacter-frequencybuddy-strings
  • StringsMediumModel answer
    Linked-Field Payment Card Form with Live Validation

    Build a browser payment card form where the detected card network drives number formatting, length checks and security-code rules, with validation and a submit callback.

    Stringsfrontendform-validationluhninput-formatting
  • StringsEasyModel answer
    Find Unique Words Across Two Text Blocks

    Identify words that appear in either of two given text strings, but not in both, using symmetric set difference.

    Stringsstringsarraysset-operations
  • StringsMediumModel answer
    Validate Palindrome Rearrangements and Sum High-Precision Decimals

    Check if a string's characters can form a palindrome, and implement precise addition of non-negative decimal strings without using native floating-point types.

    Stringsstringsmath-bitshash-table
  • StringsMediumModel answer
    Debugging and Hardening a Lightweight Template Engine

    Trace three root causes in a minimal template rendering engine—regex greediness, loop parsing, and path traversal—and present targeted fixes with regression tests.

    Stringsdebuggingparsingregexsecurity
  • StringsMediumModel answer
    Fix a Buggy Python Table-to-CSV Function

    Audit a short Python function that flattens rows into CSV text, list its correctness and performance flaws with triggering inputs, and rewrite it safely and efficiently.

    Stringscode-reviewcsvpythonstring-building
  • StringsMediumModel answer
    Three-Part Drill: Anagram Buckets, One-Swap Max, Sentiment Top-K

    A three-part coding set: bucket words by letter makeup, maximize a number with at most one digit swap, and rank hotels by keyword-based review sentiment.

    Stringshash-mapanagramsgreedytokenization
  • StringsHardModel answer
    Chunk-Safe Tokenizer for Fenced Code Blocks

    Design a stateful tokenizer that turns arbitrarily chunked Markdown into text and code-block events, correctly handling fences split across chunk boundaries.

    Stringsstreamingstate-machinestring-parsingmarkdown
  • StringsHardModel answer
    Ordered Index Pairs Whose Concatenation Reads the Same Backwards

    Given distinct lowercase words, list every ordered index pair whose concatenation is a palindrome, doing much better than checking all pairs.

    Stringspalindrometriehashingkmp
  • StringsMediumModel answer
    Bootstrapping a Reproducible Python Environment with Bash

    Write and explain a Bash script that creates or reuses a Python virtual environment and installs dependencies, covering strict mode, idempotency, activation pitfalls, and resulting files.

    Stringsbashshell-scriptingpython-venvautomation
  • StringsMediumModel answer
    Three Compiler Defects in a Mini Template Engine: Debug and Test

    Diagnose three failures in a small Python template-to-source compiler: a lost ternary branch, a directory returned as a template, and a comment-only loop body, then fix each and add a regression test.

    Stringsdebuggingcode-generationastregression-testing
  • StringsMediumModel answer
    Repair a Rewards Calculator: Three Red Tests in a Java Service

    Diagnose and fix three failing JUnit tests in a Java rewards service by touching at most three files, then explain how to keep similar bugs from coming back.

    Stringsjavadebuggingunit-testingjunit
  • StringsMediumModel answer
    Config-Driven CSV Validator with Name Overlap Check

    Write a configurable validator that flags missing fields, length violations, banned words, and low name-word overlap across CSV vendor rows.

    Stringscsv-parsingvalidationregextext-normalization
  • StringsMediumModel answer
    Build a POSIX Shell Script with Validation and Structured Output

    Write a strict POSIX sh script that validates arguments, reads a file, extracts a license string, and prints a formatted timestamped line.

    StringsshellPOSIXCLIerror-handling
  • StringsMediumModel answer
    Find Optimal Single Digit Exchange to Maximize Value

    Swap at most two digits in a non-negative integer to achieve the largest possible result.

    Stringsgreedystring-manipulationoptimization
  • StringsMediumModel answer
    Aggregate HTTP Logs to Identify Top Client Addresses

    Parse multi-file request logs to extract and rank the five IPv4 addresses that generated the most completed HTTP requests.

    Stringsparsingregexaggregationtop-k
  • StringsMediumModel answer
    CSV Transaction Parser with Validation and Error Handling

    Design a pipeline that parses CSV transaction records, normalizes fields, validates data integrity, and segregates malformed entries.

    Stringsdata-validationparsingerror-handling
  • StringsMediumModel answer
    Rule Engine with Operator Precedence and Quoted Strings

    Build a transaction filter that evaluates accept/block rules in sequence, supporting field equality, boolean logic, AND/OR operators, and parentheses.

    Stringsparsingstring-matchingoperator-precedencetokenization
  • StringsMediumModel answer
    Build a CSV Parser from Scratch with Corruption Handling

    Write a from-scratch CSV tokenizer and data structure for downstream consumers, then extend it to handle rows with missing or extra fields.

    Stringsparsingcsvstring-manipulationerror-handling
  • StringsMediumModel answer
    Rule-Driven CSV Validator with Cross-Field Word Overlap

    Design and implement a configurable validator that flags per-field rule violations and excessive word overlap across fields in a company CSV.

    Stringscsv-parsingvalidationstring-normalizationrule-engine