170+ hands-on TypeScript exercises with worked solutions. Practice everything from basic type annotations to advanced type-level programming, and track your progress as you go.
Get comfortable with the basics: primitive types, annotations, and your first type errors.
Rebuild the built-in utility types like Pick, Readonly, and Exclude to understand how mapped types really work.
Dig into conditional types, infer, template literal types, and recursion — the tools behind every advanced TypeScript library.
Type-level parsers, arithmetic, and pattern matching. If you can solve these, you can type anything.
Not sure where to start? Skim the TypeScript concept guides first, or jump straight into the full list below — each challenge links the concepts and compiler errors you will run into while solving it.
Start your TypeScript journey with the classic "Hello World" coding challenge. Learn by doing, get instant feedback, and master TypeScript basics step-by-step on TypeScriptPro.
Learn to implement TypeScript's built-in Pick utility type from scratch. Master type manipulation and generic constraints with this easy-level TypeScript challenge on TypeScriptPro.
Learn to implement TypeScript's built-in Readonly utility type from scratch. Master readonly properties and mapped types with this easy-level TypeScript challenge on TypeScriptPro.
Transform TypeScript tuples into object types with this easy-level challenge. Learn about const assertions, mapped types, and literal types on TypeScriptPro.
Extract the first element type from TypeScript arrays and tuples. Master indexed access types and conditional types in this easy-level challenge on TypeScriptPro.
Get the length of TypeScript tuples at the type level. Learn about tuple types and the length property in this easy-level challenge on TypeScriptPro.
Implement TypeScript's built-in Exclude utility type from scratch. Master conditional types and type distribution in this easy-level challenge on TypeScriptPro.
Unwrap Promise types recursively with TypeScript. Learn conditional types, infer keyword, and recursive types in this easy-level challenge on TypeScriptPro.
Implement conditional logic at the type level with TypeScript. Master conditional types and type constraints in this easy-level challenge on TypeScriptPro.
Implement array concatenation at the type level with TypeScript. Learn about tuple types and the spread operator in this easy-level challenge on TypeScriptPro.
Check if an array includes a value at the type level. Learn about recursive types and type equality in this easy-level TypeScript challenge on TypeScriptPro.
Add elements to the end of tuples with TypeScript's type system. Master the spread operator and tuple manipulation in this easy-level challenge on TypeScriptPro.
Add elements to the beginning of tuples with TypeScript. Learn tuple manipulation and spread operators in this easy-level challenge on TypeScriptPro.
Extract function parameter types with TypeScript. Master the infer keyword and function type manipulation in this easy-level challenge on TypeScriptPro.
Implement the built-in `ReturnType<T>` generic without using it. Learn conditional types with `infer` in this medium-level challenge on TypeScriptPro.
Implement the built-in `Omit<T, K>` generic without using it. Learn union type manipulation in this medium-level challenge on TypeScriptPro.
Implement a generic `MyReadonly2<T, K>` which takes two type argument `T` and `K`. Learn how to use `readonly` modifiers in this medium-level challenge on TypeScriptPro.
Implement a generic `DeepReadonly<T>` which makes every parameter of an object - and its sub-objects recursively - readonly. Learn readonly modifiers in this medium-level challenge on TypeScriptPro.
Implement a generic `TupleToUnion<T>` which covers the values of a tuple to its values union. Learn conditional types with `infer`, union type manipulation, tuple manipulation in this medium-level challenge on TypeScriptPro.
Chainable options are commonly used in Javascript. But when we switch to TypeScript, can you properly type it? Master advanced TypeScript type manipulation in this medium-level challenge on TypeScriptPro.
Extract the last element type from TypeScript arrays and tuples. Master conditional types with `infer` in this medium-level challenge on TypeScriptPro.
Remove the last element from an array. Learn array type operations in this medium-level challenge on TypeScriptPro.
Implement a type-safe version of Promise.all that preserves tuple types and recursively unwraps nested promises. Master advanced TypeScript techniques including recursive types, mapped types, and conditional types in this medium-level challenge on TypeScriptPro.
Implement the `LookUp<U, T>` type, that looks up a type in a union by its attributes. Learn union type manipulation in this medium-level challenge on TypeScriptPro.
Implement `TrimLeft<T>` which takes an exact string type and returns a new string with the whitespace beginning removed. Master advanced TypeScript template literal types in this medium-level challenge on TypeScriptPro.
Implement `Trim<T>` which takes an exact string type and returns a new string with the whitespace from both ends removed. Master TypeScript template literal types in this medium-level challenge on TypeScriptPro.
Implement `Capitalize<T>` which converts the first letter of a string to uppercase and leave the rest as-is. Master TypeScript template literal types in this medium-level challenge on TypeScriptPro.
Implement `Replace<S, From, To>` which replaces the string `From` with `To` in the given string `S`. Master TypeScript template literal types in this medium-level challenge on TypeScriptPro.
Implement `ReplaceAll<S, From, To>` which replaces the substring `From` with `To` in the given string `S`. Master TypeScript template literal types in this medium-level challenge on TypeScriptPro.
Implement the `AppendArgument<Fn, A>` type, that appends a new argument to parameters of a function type. Learn TypeScript function types in this medium-level challenge on TypeScriptPro.
Implement permutation type that transforms union types into the array that includes permutations of unions. Learn union type manipulation in this medium-level challenge on TypeScriptPro.
Compute the length of a string literal, which behaves like `String.length`. Master TypeScript template literal types in this medium-level challenge on TypeScriptPro.
In this challenge, you would need to write a type that takes an array and emitted the flatten array type. Learn array type operations in this medium-level challenge on TypeScriptPro.
Implement a Generic Type that can append a new field to any object type. Master mapped types in TypeScript in this medium-level challenge on TypeScriptPro.
Implement the `Absolute` type. A type that takes string, number or bigint and returns a positive number string. Master TypeScript template literal types in this medium-level challenge on TypeScriptPro.
Implement the String to Union type, that turns a string into a union of its characters. Learn TypeScript template literal types in this medium-level challenge on TypeScriptPro.
Implement the `Merge<F, S>` type, that merges two types into a new type. Master mapped types in TypeScript in this medium-level challenge on TypeScriptPro.
Replace the `camelCase` or `PascalCase` string with `kebab-case`. Learn TypeScript template literal types in this medium-level challenge on TypeScriptPro.
Implement the `Diff<O, O1>` type, that returns an object with the difference between two objects. Master union and intersection types in TypeScript in this medium-level challenge on TypeScriptPro.
Implement Python liked `any` function in the type system. A type takes the Array and returns `true` if any element of the Array is true. If the Array is empty, return `false`. Learn array type operations in this medium-level challenge on TypeScriptPro.
Implement a `IsNever` Generic, which allows you to check if a type is never. Learn type distribution in TypeScript in this medium-level challenge on TypeScriptPro.
Implement a type `IsUnion`, which takes an input type `T` and returns whether `T` resolves to a union type. Learn union type manipulation in this medium-level challenge on TypeScriptPro.
Implement a type ReplaceKeys, that replace keys in union types, if some type has not this key, just skip replacing, Master advanced TypeScript type manipulation in this medium-level challenge on TypeScriptPro.
Implement `RemoveIndexSignature<T>` , exclude the index signature from object types. Master advanced TypeScript type manipulation in this medium-level challenge on TypeScriptPro.
Implement PercentageParser<T extends string>. Master advanced TypeScript type manipulation in this medium-level challenge on TypeScriptPro.
Implement the `DropChar<S, C>` type, that drops a specified char from a string. Learn template literal types in TypeScript in this medium-level challenge on TypeScriptPro.
Given a number (always positive) as a type. Your type should return the number decreased by one. Master advanced TypeScript type manipulation in this medium-level challenge on TypeScriptPro.
From `T`, pick a set of properties whose type are assignable to `U`. Master advanced TypeScript type manipulation in this medium-level challenge on TypeScriptPro.
Implement `StartsWith<T, U>` which takes two exact string types and returns whether `T` starts with `U` Master advanced TypeScript type manipulation in this medium-level challenge on TypeScriptPro.
Implement `EndsWith<T, U>` which takes two exact string types and returns whether `T` ends with `U` Master advanced TypeScript type manipulation in this medium-level challenge on TypeScriptPro.
Implement a generic `PartialByKeys<T, K>` which takes two type argument `T` and `K`. Master advanced TypeScript type manipulation in this medium-level challenge on TypeScriptPro.
Implement a generic `RequiredByKeys<T, K>` which takes two type argument `T` and `K`. Master advanced TypeScript type manipulation in this medium-level challenge on TypeScriptPro.
Implement the generic ```Mutable<T>``` which makes all properties in ```T``` mutable (not readonly). Learn readonly modifiers in this medium-level challenge on TypeScriptPro.
From ```T```, pick a set of properties whose type are not assignable to ```U```. Master advanced TypeScript type manipulation in this medium-level challenge on TypeScriptPro.
Implement the type version of ```Object.entries``` Master advanced TypeScript type manipulation in this medium-level challenge on TypeScriptPro.
Implement the type version of ```Array.shift``` Learn array type operations in this medium-level challenge on TypeScriptPro.
Given a tuple type ```T``` that only contains string type, and a type ```U```, build an object recursively. Learn tuple manipulation in this medium-level challenge on TypeScriptPro.
Implement the type version of `Array.reverse()`. Learn tuple manipulation in TypeScript in this medium-level challenge on TypeScriptPro.
Implement the type version of lodash's ```_.flip```. Master advanced TypeScript type manipulation in this medium-level challenge on TypeScriptPro.
Recursively flatten array up to depth times. Learn array type operations in this medium-level challenge on TypeScriptPro.
The Block, Element, Modifier methodology (BEM) is a popular naming convention for classes in CSS. Master advanced TypeScript type manipulation in this medium-level challenge on TypeScriptPro.
Implement the type version of binary tree inorder traversal. Master recursive conditional types and tree structures in this medium-level challenge on TypeScriptPro.
Implement the type of `just-flip-object`. Examples: Master advanced TypeScript type manipulation in this medium-level challenge on TypeScriptPro.
Implement a generic `Fibonacci<T>` that takes a number `T` and returns its corresponding [Fibonacci number](https://en.wikipedia.org/wiki/Fibonacci_number). Master advanced TypeScript type manipulation in this medium-level challenge on TypeScriptPro.
Implement type ```AllCombinations<S>``` that return all combinations of strings which use characters from ```S``` at most once. Master advanced TypeScript type manipulation in this medium-level challenge on TypeScriptPro.
In This Challenge, You should implement a type `GreaterThan<T, U>` like `T > U` Learn array type operations in this medium-level challenge on TypeScriptPro.
In This Challenge, You should implement a type `Zip<T, U>`, T and U must be `Tuple` Learn tuple manipulation in this medium-level challenge on TypeScriptPro.
Implement a type ```IsTuple```, which takes an input type ```T``` and returns whether ```T``` is tuple type. Learn tuple manipulation in this medium-level challenge on TypeScriptPro.
Do you know `lodash`? `Chunk` is a very useful function in it, now let's implement it. Learn tuple manipulation in this medium-level challenge on TypeScriptPro.
`Fill`, a common JavaScript function, now let us implement it with types. Learn tuple manipulation in this medium-level challenge on TypeScriptPro.
Implement `TrimRight<T>` which takes an exact string type and returns a new string with the whitespace ending removed. Master advanced TypeScript type manipulation in this medium-level challenge on TypeScriptPro.
Implement the type version of Lodash.without, Without<T, U> takes an Array T, number or array U and returns an Array without the elements of U. Learn union type manipulation, array type operations in this medium-level challenge on TypeScriptPro.
Implement the type version of ```Math.trunc```, which takes string or number and returns the integer part of a number by removing any fractional digits. Master advanced TypeScript type manipulation in this medium-level challenge on TypeScriptPro.
Implement the type version of Array.indexOf, indexOf<T, U> takes an Array T, any U and returns the index of the first U in Array T. Learn array type operations in this medium-level challenge on TypeScriptPro.
Implement the type version of Array.join, Join<T, U> takes an Array T, string or number U and returns the Array T with U stitching up. Learn array type operations in this medium-level challenge on TypeScriptPro.
Implement the type version of ```Array.lastIndexOf```, ```LastIndexOf<T, U>``` takes an Array ```T```, any ```U``` and returns the index of the last ```U``` in Array ```T``` Learn array type operations in this medium-level challenge on TypeScriptPro.
Implement the type version of Lodash.uniq, Unique<T> takes an Array T, returns the Array T without repeated values. Learn array type operations in this medium-level challenge on TypeScriptPro.
Implement `MapTypes<T, R>` which will transform types in object T to different types defined by type R which has the following structure Master advanced TypeScript type manipulation in this medium-level challenge on TypeScriptPro.
Construct a tuple with a given length. Learn tuple manipulation in this medium-level challenge on TypeScriptPro.
Sometimes we want to limit the range of numbers... Master advanced TypeScript type manipulation in this medium-level challenge on TypeScriptPro.
Given an array of strings, do Permutation & Combination. Learn array type operations in this medium-level challenge on TypeScriptPro.
Given an array of unique elements, return all possible subsequences. Learn union type manipulation in this medium-level challenge on TypeScriptPro.
Implement type CheckRepeatedChars<S> which will return whether type S contains duplicated chars. Learn union type manipulation in this medium-level challenge on TypeScriptPro.
Given a string s, find the first non-repeating character in it and return its index. If it does not exist, return -1. (Inspired by [leetcode 387](https://leetcode.com/problems/first-unique-character-in-a-string/)) Master advanced TypeScript type manipulation in this medium-level challenge on TypeScriptPro.
You're required to implement a type-level parser to parse URL params string into an Union. Learn conditional types with `infer` in this medium-level challenge on TypeScriptPro.
Get the middle element of the array by implementing a `GetMiddleElement` method, represented by an array Master advanced TypeScript type manipulation in this medium-level challenge on TypeScriptPro.
Find the elements in the target array that appear only once. For example:input: `[1,2,2,3,3,4,5,6,6,6]`,output: `[1,4,5]`. Master advanced TypeScript type manipulation in this medium-level challenge on TypeScriptPro.
With type ``CountElementNumberToObject``, get the number of occurrences of every item from an array and return them in an object. For example: Master advanced TypeScript type manipulation in this medium-level challenge on TypeScriptPro.
Please complete type `Integer<T>`, type `T` inherits from `number`, if `T` is an integer return it, otherwise return `never`. Master advanced TypeScript type manipulation in this medium-level challenge on TypeScriptPro.
Convert a property of type literal (label type) to a primitive type. Master advanced TypeScript type manipulation in this medium-level challenge on TypeScriptPro.
Implement a generic DeepMutable<T> which make every parameter of an object - and its sub-objects recursively - mutable. Learn recursive type definitions, readonly modifiers in this medium-level challenge on TypeScriptPro.
Returns true if all elements of the list are equal to the second parameter passed in, false if there are any mismatches. Learn array type operations in this medium-level challenge on TypeScriptPro.
Implement the type `Filter<T, Predicate>` takes an Array `T`, primitive type or union primitive type `Predicate` and returns an Array include the elements of `Predicate`. Learn array type operations in this medium-level challenge on TypeScriptPro.
Implement the type-level equal operator that returns a boolean for whether two given types are equal. Master conditional types and type comparison in this medium-level challenge on TypeScriptPro.
Given a pattern string P and a text string T, implement the type FindAll<T, P> that returns an Array that contains all indices (0-indexed) from T where P matches. Master advanced TypeScript type manipulation in this medium-level challenge on TypeScriptPro.
1. Combine multiple modifier keys, but the same modifier key combination cannot appear. Master advanced TypeScript type manipulation in this medium-level challenge on TypeScriptPro.
Given a generic tuple type `T extends unknown[]`, write a type which produces all permutations of `T` as a union. Learn union type manipulation, tuple manipulation in this medium-level challenge on TypeScriptPro.
Implement the type ReplaceFirst<T, S, R> which will replace the first occurrence of S in a tuple T with R. If no such S exists in T, the result should be T. Master advanced TypeScript type manipulation in this medium-level challenge on TypeScriptPro.
The transpose of a matrix is an operator which flips a matrix over its diagonal; that is, it switches the row and column indices of the matrix A by producing another matrix, often denoted by A<sup>T</sup>. Learn array type operations in this medium-level challenge on TypeScriptPro.
Implement the generic type JSONSchema2TS which will return the TypeScript type corresponding to the given JSON schema. Master advanced TypeScript type manipulation in this medium-level challenge on TypeScriptPro.
Given a number, your type should return its square. Learn tuple manipulation, array type operations in this medium-level challenge on TypeScriptPro.
Given a number N, find the Nth triangular number, i.e. `1 + 2 + 3 + ... + N` Learn tuple manipulation, array type operations in this medium-level challenge on TypeScriptPro.
Given 2 sets (unions), return its Cartesian product in a set of tuples, e.g. Learn union type manipulation in this medium-level challenge on TypeScriptPro.
Merge variadic number of types into a new type. If the keys overlap, its values should be merged into an union. Learn union type manipulation, array type operations in this medium-level challenge on TypeScriptPro.
Implement type `CheckRepeatedChars<T>` which will return whether type `T` contains duplicated member Master advanced TypeScript type manipulation in this medium-level challenge on TypeScriptPro.
Remove the key starting with `_` from given type `T`. Master advanced TypeScript type manipulation in this medium-level challenge on TypeScriptPro.
Implement a type that extract prop value to the interface. The type takes the two arguments. The output should be an object with the prop values. Master advanced TypeScript type manipulation in this medium-level challenge on TypeScriptPro.
Implement a type`DeepOmit`, Like Utility types [Omit](https://www.typescriptlang.org/docs/handbook/utility-types.html#omittype-keys), A type takes two arguments. Master advanced TypeScript type manipulation in this medium-level challenge on TypeScriptPro.
return true is a number is odd Master advanced TypeScript type manipulation in this medium-level challenge on TypeScriptPro.
Simulate the solution for the Tower of Hanoi puzzle. Your type should take the number of rings as input an return an array of steps to move the rings from tower A to tower B using tower C as additional. Each entry in the array should be a pair of strings `[From, To]` which denotes ring being moved `From -> To`. Learn array type operations in this medium-level challenge on TypeScriptPro.
Given a number N, construct the Pascal's triangle with N rows. Learn array type operations in this medium-level challenge on TypeScriptPro.
Sometimes you may want to determine whether a string literal is a definite type. For example, when you want to check whether the type specified as a class identifier is a fixed string literal type. Master advanced TypeScript type manipulation in this medium-level challenge on TypeScriptPro.
Implement `CompareArrayLength` to compare two array length(T & U). Learn array type operations in this medium-level challenge on TypeScriptPro.
### Defined Partial Record Master advanced TypeScript type manipulation in this medium-level challenge on TypeScriptPro.
### Longest Common Prefix Master advanced TypeScript type manipulation in this medium-level challenge on TypeScriptPro.
The trace of a square matrix is the sum of the elements on its main diagonal. Master advanced TypeScript type manipulation in this medium-level challenge on TypeScriptPro.
Determine if the given letter is an alphabet. Master advanced TypeScript type manipulation in this medium-level challenge on TypeScriptPro.
Implement `Uppercase<T>`, convert all letter to uppercase Master advanced TypeScript type manipulation in this medium-level challenge on TypeScriptPro.
A Vue-style defineComponent where this means the right thing in data, computed and methods: three inferred shapes fed back into the same object literal via ThisType.
Type a currying function that turns a multi-argument function into a chain of single-argument calls. Recursive tuple inference peels one parameter per step.
Turn A | B | C into A & B & C. There is no built-in operator for this; distributive conditionals and contravariant inference get you there.
Write GetRequired<T>, which drops every optional property from an object type. The filter runs inside the mapped type: as-remapping a key to never erases it.
Build GetOptional<T>, which keeps only the optional fields of an object type. Filtering keys is half the job; each surviving property must also keep its ? modifier.
Build RequiredKeys<T>, which collects every required key of an object type into a union. Checking for undefined fails; you have to test the ? modifier itself.
Build OptionalKeys<T>, which collects every optional key of an object type into a union. The hard part: optionality is a modifier, so checking for undefined gets you nowhere.
Uppercase the first letter of every word in a string type, where a word boundary is any character without an upper or lower case form.
Convert a snake_case string type to camelCase with recursive template literal inference. The tricky part: characters that cannot be uppercased, like _ and $.
Parse a C-style printf format string at the type level, collecting placeholders like %d into a tuple. Lazy template inference handles %% escapes for free.
Extend Simple Vue with a props option: infer prop types from constructors like Boolean, String or custom classes, including unions from constructor arrays.
Detect the any type, and only any. Every obvious check produces false positives; the working one-liner is 0 extends 1 & T, and the why behind it is the real lesson.
A fully typed version of lodash's get: parse a dot-separated path string with template literal inference and resolve it to the exact value type.
Convert a string literal type to its number, like Number.parseInt but stricter. One infer extends clause replaces pages of digit-by-digit recursion.
FilterOut<T, F> removes tuple elements assignable to F. The catch is never, which makes naked conditional checks silently evaporate.
Convert a string tuple into a readonly enum-like object: PascalCase keys, filtered array keys, and index strings turned back into number literals.
Format<T> turns a printf-style format string into a curried function type, one typed argument per placeholder. The twist: the recursion builds function types, not tuples.
Brand an object and every nested object with its own identity while staying mutually assignable with the original. Nominal typing built by hand.
Count the length of a string type with a tuple accumulator. The naive recursion dies at about 45 characters; tail recursion takes you to 999.
Convert a union into a tuple even though unions have no order. The key move is extracting a single member via function overload resolution.
A curried join function whose return type is the exact joined string literal, computed from the delimiter and arguments by a recursive template literal type.
A Pick that understands dot paths like friend.family.name, building one nested pick per path and folding them into an intersection via contravariant inference.
Type Pinia's defineStore: getters are written as functions but read as values, and state is mutable in actions but read-only in getters. ThisType does the work.
Rename every snake_case key in an object type to camelCase, recursing through nested objects and tuples. The array branch must come before the object branch.
Remove every character of R from the string type S. One recursion turns R into a union of characters, another walks S and filters against it.
A type-level String.split() that turns a string type into a tuple of substrings. Reproducing JavaScript's odd empty-string rules is the hard part.
Extract the public keys of a class into a union. The answer is one line, because keyof never sees private or protected members in the first place.
IsRequiredKey<T, K> reports whether every key in K is required on T. Optionality is a modifier, not a value type, so the check compares Pick against Required.
Turn a union of [key, value] tuples into an object type, the type-level Object.fromEntries. One mapped type does it, once you know in can iterate any union.
Check whether a string or number reads the same backwards, entirely in types. A recursive template-literal split does the reversal.
Build MutableKeys<T>, a union of the non-readonly keys of an object type. Assignability checks ignore readonly, so detecting it takes the Equal trick.
The type-level version of Lodash intersection: compute what several lists have in common. Normalize every entry to a union and let & do the set math.
Convert a binary string literal like '1010' into the number type 10. The type system has no arithmetic, so tuples stand in for numbers and spreads do the math.
Generate every path string lodash _.get accepts on an object, dot and bracket notation included, by walking the type with recursive template literals.
Solve Two Sum in the type system, where there is no + operator and no loop. Two nested recursions over a tuple, with addition built from tuple lengths.
Implement ValidDate<T>, which checks whether an MMDD string is a real calendar date. Every legal month and day gets enumerated as a union of string literals.
Recreate Object.assign at the type level: merge an array of sources into a target, later sources winning. Intersections collapse conflicts to never, so they're out.
Find the largest number in a tuple type with no greater-than operator in sight. A counting tuple eliminates union members until only the maximum remains.
Capitalize every key of an object type recursively, following values into nested arrays. The branch order decides whether tuples survive the mapping.
UnionReplace<T, U> rewrites a union according to a list of [from, to] type pairs: one conditional distributes over the members, another recurses through the pairs.
Generate the FizzBuzz sequence as a tuple of string literals, without loops or a modulo operator. Tuple counters and a tail-recursive accumulator do the work.
Encode and decode run-length compressed strings at the type level, combining template literal inference, string accumulators, tuple counters and a digit trick.
Path<T> computes every valid key path through a nested object as a union of tuples. The machinery behind type-safe lodash.get and form field paths.
SnakeCase<T> converts camelCase string types to snake_case by scanning one character at a time. Union inputs work for free thanks to distributive conditionals.
IsNegativeNumber<N> returns true for negative literals, false for zero and positives, and never for number or unions. Union detection is the tricky part.
Make every property that allows undefined optional, restricted to a chosen key set. Split the object with key remapping, add the ? modifier, merge back.
Write uniqueItems, a function that rejects tuples with duplicate elements and pins the compiler error on each repeated element instead of the whole argument.
XOR two binary string literals of different lengths. Bitwise ops align at the right end, the one end template literal inference cannot reach, so you reverse first.
A type that verifies a solved Sudoku board: 27 region checks built from indexed access on tuples and one union-as-set comparison.
Count string lengths up to a million characters at the type level. Fixed-width template patterns strip 100,000 characters per match; the counts become digits.
Build Unbox<T>, which unwraps functions, promises, arrays and tuples, recursively or to a chosen depth. Fixpoint recursion meets a type-level counter.
Add two binary numbers, given as bit tuples, by modeling a full adder: a sum and a carry bit per column, carry rippling left. Tuple-length counting tricks are banned.
Filter a union of object types down to the members that have a given key. No recursion, no infer: the whole difficulty is understanding distribution.
Take<N, Arr> extracts the first N elements of a tuple, or the last N when N is negative. Accumulator counting and template literal sign detection do the work.
Grade a finished 9x9 Sudoku grid entirely in the type system. Indexed access over unions carves out rows, columns and boxes without any tuple slicing.
A selection of warm-up and easy challenges is free, including the full problem statement and solution walkthrough. Pro unlocks the complete set with interactive editors and video walkthroughs.
No. Every challenge runs in an in-browser TypeScript editor with instant type checking, so you can practice from any machine.
Work through a difficulty level at a time. The challenges are ordered so that each one builds on ideas from earlier ones, and every solution links the concept guides it relies on.
Many challenges are curated from the well-known type-challenges collection, but each one here adds a step-by-step solution explanation, links to related concept guides and TypeScript error references, and progress tracking.