Parsing interview questions
Practice 29 questions on parsing. Each runs in a real in-browser editor with Jest tests and a worked, diagram-backed solution.
29 questions
- EASY
Balanced Brackets
Implement a function that checks whether a string of brackets is properly opened and closed in order.
15 minAlgorithms - EASY
Roman to Integer
Convert a Roman numeral string to its integer value, handling subtractive pairs like IV and IX.
15 minAlgorithmsAmazon · Microsoft · Adobe - EASY
Text Search
Implement a function that wraps occurrences of a search term within a string in highlight markup.
15 minJavaScript - MEDIUM
Arithmetic Expression Evaluator
Tokenize and evaluate a math expression string with operator precedence, parentheses, and unary minus.
35 minJavaScriptGoogle · Amazon · Microsoft - MEDIUM
Base Converter
PREMIUMConvert a number's string representation between any two bases from 2 to 36 — parse the digits in the source base, then re-emit them in the target base.
25 minJavaScript - MEDIUM
Case Converters
Convert any string between camelCase, snake_case, kebab-case, and PascalCase by tokenizing it into words first.
35 minJavaScript - MEDIUM
Decode Message
Implement a function that counts how many ways a digit string can be decoded into letters using a 1 to 26 mapping.
25 minAlgorithms - MEDIUM
Get
PREMIUMImplement a function that safely reads a nested object path and returns a default when any segment is missing.
25 minJavaScript - MEDIUM
i18n Engine
PREMIUMBuild a translation engine with nested key lookup, variable interpolation, pluralization, and locale fallback.
25 minJavaScript - MEDIUM
ICU Message Formatter
Parse and format ICU MessageFormat strings with plural, select, and nested argument substitution.
25 minJavaScript - MEDIUM
IPv4 / IPv6 Validate
Validate IPv4 dotted-quad and IPv6 addresses, handling octet ranges, leading zeros, and :: zero-group compression.
25 minJavaScript - MEDIUM
Object Path set / unset
Implement lodash-style set and unset: write or delete a value at a deep object path, creating containers as needed.
35 minJavaScript - MEDIUM
Semver Compare
PREMIUMParse and compare two semantic version strings — major, minor, patch, and prerelease — returning -1, 0, or 1 with correct prerelease precedence.
25 minJavaScript - MEDIUM
Spreadsheet
Implement a spreadsheet class that resolves numeric cell values and evaluates simple addition formulas.
25 minJavaScript - MEDIUM
Spreadsheet II
Build a spreadsheet class that evaluates left-to-right arithmetic formulas referencing other cells.
25 minJavaScript - MEDIUM
SSE Frame Decoder
PREMIUMDecode a Server-Sent Events stream arriving in arbitrary chunks into discrete parsed events.
25 minJavaScript - MEDIUM
String to Number (parseInt)
Reimplement JavaScript's parseInt — skip leading whitespace, read an optional sign and radix prefix, consume valid digits for the base, and stop at the first invalid character.
25 minJavaScript - MEDIUM
Template Engine
Implement a template renderer that substitutes Mustache-style placeholders with values from a data object.
25 minJavaScript - MEDIUM
Text Search II
Implement a function that wraps every occurrence of any term from a list inside highlight markup.
25 minJavaScript - MEDIUM
Tool-Call Streaming State Machine
PREMIUMTrack streaming LLM tool calls by id, accumulating argument deltas and guarding each pending, running, and done transition.
25 minJavaScript - MEDIUM
Unsquash Object
Implement a function that rebuilds a nested object from a flat map of dot-delimited keys.
25 minJavaScript - MEDIUM
URLSearchParams
Implement a URLSearchParams-style class with get, getAll, append, set, and toString over an encoded query string.
25 minJavaScript - HARD
Data Selection
PREMIUMImplement a function that filters an array of row objects by a flexible field-and-condition specification.
40 minJavaScript - HARD
JSON.parse
PREMIUMImplement JSON.parse — a recursive-descent parser that turns a JSON string into the corresponding JavaScript value.
40 minJavaScript - HARD
Partial JSON Parser
PREMIUMParse a truncated JSON string into the best-valid value so far by completing open strings and containers.
40 minJavaScript - HARD
Spreadsheet Grid
PREMIUMBuild a grid of cells with formula evaluation and dependent-cell recalculation.
40 minUI / FrameworksAngularReactHTML / CSS / JSVue - HARD
Streaming Markdown State Machine
PREMIUMRender markdown-so-far to HTML, holding and closing unclosed bold, inline code, and fenced code blocks.
40 minJavaScript - HARD
Superjson
PREMIUMImplement serialize and deserialize helpers that round-trip values like Date, Map, Set, and BigInt through JSON.
40 minJavaScript - HARD
Table of Contents
PREMIUMImplement a function that walks an HTML document's headings and builds a nested table of contents.
40 minJavaScript