Formatting interview questions
Practice 19 questions on formatting. Each runs in a real in-browser editor with Jest tests and a worked, diagram-backed solution.
19 questions
- EASY
Countdown Timer
Build a countdown timer that ticks down from a start time and can start, pause, and reset.
15 minUI / FrameworksAngularReactHTML / CSS / JSVue - EASY
List Format
Implement a function that joins an array of strings into a grammatical list with commas and a conjunction.
15 minJavaScript - EASY
Text Search
Implement a function that wraps occurrences of a search term within a string in highlight markup.
15 minJavaScript - MEDIUM
classNames
Implement a utility that conditionally joins class name arguments into a single space-separated string.
25 minJavaScript - MEDIUM
Currency Converter
Build a currency converter with two linked amount fields that recompute from an exchange rate.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Digital Clock
Build a 7-segment style digital clock that updates to display the current time.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
HTML Serializer
Implement a function that serializes a tree-shaped object into a pretty-printed HTML string with indentation.
25 minJavaScript - MEDIUM
i18n Engine
PREMIUMBuild a translation engine with nested key lookup, variable interpolation, pluralization, and locale fallback.
25 minJavaScript - MEDIUM
JSON.stringify
PREMIUMImplement a function that converts a JavaScript value into its JSON string representation.
25 minJavaScript - MEDIUM
Round to Precision
Round, floor, and ceil a number to N decimal places without the classic floating-point drift — 1.005 must round to 1.01, not 1.00.
25 minJavaScript - MEDIUM
Shopping Cart
Build a cart where quantity changes update line totals and a grand total live.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Stopwatch
Build a stopwatch widget that measures elapsed time with start, stop, and reset controls.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Template Engine
Implement a template renderer that substitutes Mustache-style placeholders with values from a data object.
25 minJavaScript - MEDIUM
Thousands Separator
Group a number's integer digits with separators — 1234567 to 1,234,567 — handling decimals, negatives, and a custom separator.
25 minJavaScript - MEDIUM
Truncate String
Implement lodash truncate — cut a string to a maximum length, append an ellipsis, and optionally break on the last word boundary before the limit.
25 minJavaScript - HARD
classNames II
PREMIUMExtend the classNames utility to dedupe class names and resolve function arguments lazily.
40 minJavaScript - HARD
Integer to English Words
PREMIUMSpell out a non-negative integer in English words — break it into groups of three digits and name each group with its scale word.
40 minJavaScript - HARD
JSON.stringify II
PREMIUMImplement JSON.stringify with full spec support including replacer, indentation, and circular reference detection.
40 minJavaScript - HARD
Rich Text to HTML
PREMIUMImplement a function that converts a list of styled text ranges into a canonical, properly nested HTML string.
40 minJavaScript