Hard

Simple Vue

HARD
0
8
@typehero

Implement a simpiled version of a Vue-like typing support.

By providing a function name `SimpleVu

Union to Intersection

HARD
0
5
@typehero

Implement the advanced util type UnionToIntersection<U>

For example

type I = UnionToInte

Get Required

HARD
0
1
@typehero

Implement the advanced util type GetRequired<T>, which remains all the required fields

For exam

Get Optional

HARD
0
2
@typehero

Implement the advanced util type GetOptional<T>, which remains all the optional fields

For exam

Required Keys

HARD
0
1
@typehero

Implement the advanced util type RequiredKeys<T>, which picks all the required keys into a union

Optional Keys

HARD
0
1
@typehero

Implement the advanced util type OptionalKeys<T>, which picks all the optional keys into a union

Capitalize Words

HARD
0
1
@typehero

Implement CapitalizeWords<T> which converts the first letter of each word of a string to upp

CamelCase

HARD
0
0
@typehero

Implement CamelCase<T> which converts snake_case string to camelCase.

For example

ty

C-printf Parser

HARD
0
1
@typehero

There is a function in C language: printf. This function allows us to print something with forma

IsAny

HARD
0
1
@typehero

Sometimes it's useful to detect if you have a value with any type. This is especially helpful wh

String to Number

HARD
0
3
@typehero

Convert a string literal to a number, which behaves like Number.parseInt.

Tuple Filter

HARD
0
1
@typehero

Implement a type FilterOut<T, F> that filters out items of the given type F from the tuple T

Tuple to Enum Object

HARD
0
1
@typehero

The enum is an original syntax of TypeScript (it does not exist in JavaScript). So it is converted

printf

HARD
0
1
@typehero

Implement Format<T extends string> generic.

For example,

type FormatCase1 = Format<"%sab

Deep object to unique

HARD
0
0
@typehero

TypeScript has structural type system, but sometimes you want a function to accept only some previ

Length of String 2

HARD
0
0
@typehero

Implement a type LengthOfString<S> that calculates the length of the template string (as in [298

Union to Tuple

HARD
1
3
@typehero

Implement a type, UnionToTuple, that converts a union to a tuple.

As we know, union is an unord

String Join

HARD
0
1
@typehero

Create a type-safe string join utility which can be used like so:

const hyphenJoiner = join

DeepPick

HARD
0
1
@typehero

Implement a type DeepPick, that extends Utility types Pick. A type takes two arguments.

For ex

Camelize

HARD
0
1
@typehero

Implement Camelize which converts object from snake_case to to camelCase

Camelize<{ some_

Drop String

HARD
0
2
@typehero

Drop the specified chars from a string.

For example:

type Butterfly = DropString<'foobar!'

Split

HARD
0
1
@typehero

The well known split() method splits a string into an array of substrings by looking for a separ

ClassPublicKeys

HARD
0
1
@typehero

Implement the generic ClassPublicKeys<T> which returns all public keys of a class.

For example:

IsRequiredKey

HARD
0
1
@typehero

Implement a generic IsRequiredKey<T, K> that return whether K are required keys of ``

ObjectFromEntries

HARD
0
1
@typehero

Implement the type version of Object.fromEntries

For example:

interface Mode

InorderTraversal

HARD
0
0
@typehero

Implement the type version of binary tree inorder traversal.

For example:

const tr

IsPalindrome

HARD
0
3
@typehero

Implement type IsPalindrome<T> to check whether a string or number is palindrome.

For exam

Mutable Keys

HARD
0
2
@typehero

Implement the advanced util type MutableKeys, which picks all the mutable (not readonly) keys i

Intersection

HARD
0
2
@typehero

Implement the type version of Lodash.intersection with a little difference. Intersection takes

Binary to Decimal

HARD
0
3
@typehero

Implement BinaryToDecimal<S> which takes an exact string type S consisting 0 and 1 and returns

Two Sum

HARD
0
1
@typehero

Given an array of integers nums and an integer target, return true if two numbers such that th

ValidDate

HARD
1
1
@typehero

Implement a type ValidDate, which takes an input type T and returns whether T is a valid date.

Assign

HARD
0
3
@typehero

You have a target object and a source array of objects. You need to copy property from source to t

Maximum

HARD
0
3
@typehero

Description

Implement the type Maximum, which takes an input type T, and returns the

Capitalize Nest Object Keys

HARD
0
1
@typehero

Capitalize the key of the object, and if the value is an array, iterate through the objects in the

Replace Union

HARD
1
2
@typehero

Given an union of types and array of type pairs to replace ([[string, number], [Date, null]]

FizzBuzz

HARD
0
2
@typehero

The FizzBuzz problem is a classic test given in coding interviews. The task is simple:

Print in

Run-length encoding

HARD
0
2
@typehero

Given a string sequence of a letters f.e. AAABCCXXXXXXY. Return run-length encoded string `3AB

Tree path array

HARD
0
2
@typehero

Create a type Path that represents validates a possible path of a tree under the form of an ar

SnakeCase

HARD
0
1
@typehero

Create a SnakeCase<T> generic that turns a string formatted in camelCase into a string forma

IsNegativeNumber

HARD
0
1
@typehero

Sometimes when working with numeric literals, we need to rule out (or enforce) that the provided n

OptionalUndefined

HARD
0
1
@typehero

Implement the util type OptionalUndefined<T, Props> that turns all the properties of T that ca

BitwiseXOR

HARD
0
2
@typehero

Implement BitwiseXOR<S1,S2> which takes two binary string literal type and returns a binary

Unique Items

HARD
0
1
@typehero

Some concepts in TypeScript can not be described by types, but can be expressed through type const

Length of String 3

HARD
0
1
@typehero

Implement a type LengthOfString<S> just like Array#length:

Differing to two previous challeng

Unbox

HARD
0
1
@typehero

How can we build a type that "unboxes" arrays, functions, promises, and tuples?

Example:

Binary Addition

HARD
0
1
@typehero

Implement BinaryAdd to add two binary numbers together. The numbers should not be translated out

Take Elements

HARD
0
1
@typehero

Implement a type Take<N, Arr> that returns the first N elements from an array Arr. If N is

Union to Object from key

HARD
0
1
@Type Challenges

Find the object containing the key in the union type by the key. It takes two parameters: a union

Valid Sudoku

HARD
0
1
@Type Challenges

Sudoku is a famous paper and pencil game. The goal of Sudoku is to fill a 9x9 grid with numbers so