Composition interview questions
Practice 20 questions on composition. Each runs in a real in-browser editor with Jest tests and a worked, diagram-backed solution.
20 questions
- EASY
Compose
Implement a function that composes functions right-to-left so the output of each feeds into the next.
15 minJavaScript - EASY
Promise Waterfall
Run async tasks in sequence, feeding each result into the next, stopping the chain on the first rejection.
15 minJavaScript - MEDIUM
Class Variance Authority
Implement a simplified cva that builds class names from base styles, variant tables, and default values.
25 minJavaScript - MEDIUM
Curry
Implement a function that transforms a multi-argument function into a chain of single-argument calls.
25 minJavaScript - MEDIUM
flow
Implement flow — compose functions left to right so each output feeds the next.
25 minJavaScript - MEDIUM
Form Validation Engine
Build a schema-driven form validator with composable per-field rules, cross-field checks, and async validators that report all errors.
30 minJavaScriptStripe · Atlassian · Airbnb - MEDIUM
HTTP Client Interceptors
PREMIUMBuild an axios-style client whose request and response interceptors transform each call as it passes through the chain.
25 minJavaScript - MEDIUM
Mini Redux
PREMIUMBuild a Redux core with createStore, combineReducers, and applyMiddleware over a subscribe/dispatch loop.
25 minJavaScript - MEDIUM
negate / overEvery
Implement negate, overEvery, and overSome — build new predicates by combining existing ones.
25 minJavaScript - MEDIUM
Promise Merge
Implement a function that combines the results of two promises into a single value using a merger function.
25 minJavaScript - MEDIUM
Redux Middleware (Thunk + Logger)
PREMIUMImplement the curried Redux middleware chain with working thunk and logger middleware.
25 minJavaScript - MEDIUM
Schema Validator
Implement a small schema library that validates primitives and flat object shapes with composable rules.
25 minJavaScript - MEDIUM
Schema Validator II
Build a tiny schema validation library that supports chainable min and max rules on primitive types.
25 minJavaScript - MEDIUM
Tabs
Build a tabs component that shows one panel at a time based on the currently selected tab.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Test Runner II
Build a small test runner that supports nested describe suites and reports tests with their full spec names.
25 minJavaScript - MEDIUM
Test Runner III
Extend a tiny test runner with beforeEach and afterEach hooks that are inherited from outer suites.
25 minJavaScript - HARD
Data Table III
PREMIUMBuild a generic, reusable data table that supports column-driven sorting and pagination for any dataset.
40 minUI / FrameworksAngularReactHTML / CSS / JSVue - HARD
Drizzle Query Builder
PREMIUMBuild an in-memory query builder inspired by Drizzle with table helpers, filters, sorting, and pagination.
40 minJavaScript - HARD
Drizzle Query Builder II
PREMIUMExtend an in-memory query builder inspired by Drizzle with select projections and column aliases.
40 minJavaScript - HARD
Middlewares
PREMIUMImplement an async middleware composer that chains functions Koa-style, threading a shared context through next.
40 minJavaScript