TypeScript practice
Every TypeScript exercise, built from a topic you can open beside it.
76 exercises runs offline
All tracks Python 139 JavaScript 184 TypeScript 76 Go 106 Rust 75 Java 81 Kotlin 66 C++ 92 C# 88 Swift 68 PHP 69 Frontend 82 Backend 139 Architecture and system design 25 DevOps and cloud 15 Data and databases 5 Data science 31 AI and LLM engineering 75 Security 26 Game development 26 Coding in the AI era 101 CS foundations 164
level
ts Quiz new Which conditional tests whether a union T as a whole is assignable to U? Compose conditional, mapped, indexed-access, template-literal, and recursive types without confusing compile-time guarantees with runtime checks. ts Quiz new Why does { [K in keyof M]: { type: K; payload: M[K] } }[keyof M] preserve an event name-p… Compose conditional, mapped, indexed-access, template-literal, and recursive types without confusing compile-time guarantees with runtime checks. ts Predict the output new What does this program print? Compose conditional, mapped, indexed-access, template-literal, and recursive types without confusing compile-time guarantees with runtime checks. ts Review AI code new Review a generated event router Compose conditional, mapped, indexed-access, template-literal, and recursive types without confusing compile-time guarantees with runtime checks. ts Spot the bug new Spot the bug in DeepReadonly Compose conditional, mapped, indexed-access, template-literal, and recursive types without confusing compile-time guarantees with runtime checks. ts Quiz new What does value as Account do at runtime? Understand how TypeScript describes JavaScript values, infers and narrows types, and stops at runtime data boundaries. ts Predict the output new What does this program print? Understand how TypeScript describes JavaScript values, infers and narrows types, and stops at runtime data boundaries. ts Review AI code new Review a generated admin ID filter Understand how TypeScript describes JavaScript values, infers and narrows types, and stops at runtime data boundaries. ts Spot the bug new Spot the bug in firstLabel Understand how TypeScript describes JavaScript values, infers and narrows types, and stops at runtime data boundaries. ts Quiz new Why is unknown safer than any for an untrusted JSON result? Understand how TypeScript describes JavaScript values, infers and narrows types, and stops at runtime data boundaries. ts Quiz new Given a correctly constructed UserId brand over number, which assignment is safe without … Distinguish structurally identical values and connect runtime validation, assertions, and trust boundaries in an auditable contract. ts Quiz new Why should addUsd(a, b) call the UsdCents constructor on a + b? Distinguish structurally identical values and connect runtime validation, assertions, and trust boundaries in an auditable contract. ts Predict the output new What does this program print? Distinguish structurally identical values and connect runtime validation, assertions, and trust boundaries in an auditable contract. ts Review AI code new Review a generated transfer boundary Distinguish structurally identical values and connect runtime validation, assertions, and trust boundaries in an auditable contract. ts Spot the bug new Spot the bug in the UserId predicate Distinguish structurally identical values and connect runtime validation, assertions, and trust boundaries in an auditable contract. ts Quiz new What does declare function loadConfig(): Config do in a declaration file? Declaration files give existing JavaScript APIs static types; learn module boundaries, resolution, declaration emit, and tests that keep types honest. ts Quiz new A package exports both "." and "./reports". What must its declarations cover? Declaration files give existing JavaScript APIs static types; learn module boundaries, resolution, declaration emit, and tests that keep types honest. ts Predict the output new What does this program print after TypeScript erases its type-only declarations? Declaration files give existing JavaScript APIs static types; learn module boundaries, resolution, declaration emit, and tests that keep types honest. ts Review AI code new Review a generated payment declaration Declaration files give existing JavaScript APIs static types; learn module boundaries, resolution, declaration emit, and tests that keep types honest. ts Spot the bug new Spot the bug in the Session declaration Declaration files give existing JavaScript APIs static types; learn module boundaries, resolution, declaration emit, and tests that keep types honest. ts Quiz new Which type expression produces the source member names of an enum E? Enums bring named constants into both the type system and runtime; learn their output, validation boundaries, and alternatives. ts Predict the output new What does this program print? Enums bring named constants into both the type system and runtime; learn their output, validation boundaries, and alternatives. ts Review AI code new Review a generated session helper Enums bring named constants into both the type system and runtime; learn their output, validation boundaries, and alternatives. ts Spot the bug new Spot the bug in State parsing Enums bring named constants into both the type system and runtime; learn their output, validation boundaries, and alternatives. ts Quiz new Given enum Role { Admin = "ADMIN" }, which assignment type-checks without an assertion? Enums bring named constants into both the type system and runtime; learn their output, validation boundaries, and alternatives. ts Quiz new What does T extends { id: string } guarantee inside a generic function? Use type parameters to preserve relationships across inputs, outputs, and containers without claiming more than runtime code proves. ts Predict the output new What does this program print? Use type parameters to preserve relationships across inputs, outputs, and containers without claiming more than runtime code proves. ts Quiz new What useful fact does <T>(value: T) => T express that (value: any) => any does not? Use type parameters to preserve relationships across inputs, outputs, and containers without claiming more than runtime code proves. ts Review AI code new Review generated entity index Use type parameters to preserve relationships across inputs, outputs, and containers without claiming more than runtime code proves. ts Spot the bug new Spot the bug in the generic JSON decoder Use type parameters to preserve relationships across inputs, outputs, and containers without claiming more than runtime code proves. ts Quiz new What constraint does the type "auto" | string impose? Model closed states with exact values, and understand widening, as const, satisfies, discriminated unions, and runtime validation. ts Quiz new What is the usual inferred type of request.method in const request = { method: "GET" }? Model closed states with exact values, and understand widening, as const, satisfies, discriminated unions, and runtime validation. ts Predict the output new What does this program print? Model closed states with exact values, and understand widening, as const, satisfies, discriminated unions, and runtime validation. ts Review AI code new Review generated job event parser Model closed states with exact values, and understand widening, as const, satisfies, discriminated unions, and runtime validation. ts Quiz new What is the main effect of const cfg = { retry: 3 } satisfies { retry: 0 | 1 | 2 | 3 }? Model closed states with exact values, and understand widening, as const, satisfies, discriminated unions, and runtime validation. ts Spot the bug new Spot the bug in Mode parsing Model closed states with exact values, and understand widening, as const, satisfies, discriminated unions, and runtime validation. ts Quiz new Under TypeScript 6 strict checking, which statement about this declaration is correct? Check that expressions meet TypeScript contracts without discarding useful inference, and avoid mistaking the check for runtime validation. ts Quiz new Why is JSON.parse(raw) satisfies Settings not runtime validation? Check that expressions meet TypeScript contracts without discarding useful inference, and avoid mistaking the check for runtime validation. ts Predict the output new What does this program print? Check that expressions meet TypeScript contracts without discarding useful inference, and avoid mistaking the check for runtime validation. ts Review AI code new Review generated job registry Check that expressions meet TypeScript contracts without discarding useful inference, and avoid mistaking the check for runtime validation. ts Spot the bug new Spot the bug in the command registry Check that expressions meet TypeScript contracts without discarding useful inference, and avoid mistaking the check for runtime validation. ts Quiz new With strictFunctionTypes, which assignment is safe for function-property callbacks? Strict mode exposes unsafe assumptions about nulls, callbacks, class fields, iterators, and untyped code before JavaScript runs. ts Predict the output new What does this strict TypeScript program print? Strict mode exposes unsafe assumptions about nulls, callbacks, class fields, iterators, and untyped code before JavaScript runs. ts Review AI code new Review generated job runner Strict mode exposes unsafe assumptions about nulls, callbacks, class fields, iterators, and untyped code before JavaScript runs. ts Spot the bug new Spot the bug in Client settings Strict mode exposes unsafe assumptions about nulls, callbacks, class fields, iterators, and untyped code before JavaScript runs. ts Quiz new Which option is not enabled by strict: true in TypeScript 6? Strict mode exposes unsafe assumptions about nulls, callbacks, class fields, iterators, and untyped code before JavaScript runs. ts Quiz new Which comparison provides a meaningful type-coverage regression signal? Type coverage measures identifiers that escape to any; learn its limits, strict counting, boundary validation, and stable CI gates. ts Predict the output new What does this program print when JSON.parse returns any? Type coverage measures identifiers that escape to any; learn its limits, strict counting, boundary validation, and stable CI gates. ts Review AI code new Review generated type coverage runner Type coverage measures identifiers that escape to any; learn its limits, strict counting, boundary validation, and stable CI gates. ts Spot the bug new Spot the bug in profile formatting Type coverage measures identifiers that escape to any; learn its limits, strict counting, boundary validation, and stable CI gates. ts Quiz new How does type-coverage treat a value explicitly typed as unknown? Type coverage measures identifiers that escape to any; learn its limits, strict counting, boundary validation, and stable CI gates. ts Quiz new After checking "id" in value on a non-null object, what has been proved? Narrow unions and unknown values with runtime evidence, then write trustworthy custom predicates and assertion functions. ts Quiz new Why is declaring isSmallNumber(value): value is number unsafe when it returns false for n… Narrow unions and unknown values with runtime evidence, then write trustworthy custom predicates and assertion functions. ts Predict the output new What does this program print? Narrow unions and unknown values with runtime evidence, then write trustworthy custom predicates and assertion functions. ts Review AI code new Review generated webhook guard Narrow unions and unknown values with runtime evidence, then write trustworthy custom predicates and assertion functions. ts Spot the bug new Spot the bug in the Profile guard Narrow unions and unknown values with runtime evidence, then write trustworthy custom predicates and assertion functions. ts Quiz new Why can extracting an inline map callback into const render = (item) => item.name introdu… Understand how TypeScript infers types from initializers, context, and generic arguments, and where explicit contracts keep that inference honest. ts Quiz new What is the usual inferred type of config.mode in const config = { mode: "safe" }? Understand how TypeScript infers types from initializers, context, and generic arguments, and where explicit contracts keep that inference honest. ts Predict the output new What does this program print? Understand how TypeScript infers types from initializers, context, and generic arguments, and where explicit contracts keep that inference honest. ts Review AI code new Review generated invoice summary Understand how TypeScript infers types from initializers, context, and generic arguments, and where explicit contracts keep that inference honest. ts Spot the bug new Spot the bug in the event handler Understand how TypeScript infers types from initializers, context, and generic arguments, and where explicit contracts keep that inference honest. ts Quiz new A variable is declared as string | number and currently narrowed to string. Why may a lat… How TypeScript narrows unions and unknown through control flow, with exhaustive branches, honest predicates, and stable local bindings. ts Quiz new Why pass a switch default value to assertNever instead of returning "unknown"? How TypeScript narrows unions and unknown through control flow, with exhaustive branches, honest predicates, and stable local bindings. ts Predict the output new What does this program print? How TypeScript narrows unions and unknown through control flow, with exhaustive branches, honest predicates, and stable local bindings. ts Review AI code new Review generated job update decoder How TypeScript narrows unions and unknown through control flow, with exhaustive branches, honest predicates, and stable local bindings. ts Spot the bug new Spot the bug in the Invoice predicate How TypeScript narrows unions and unknown through control flow, with exhaustive branches, honest predicates, and stable local bindings. ts Quiz new What runtime effect does declaring type Combined = A & B have? Model alternatives with unions, combine constraints with intersections, and keep compositions safe through narrowing, discriminants, and never checks. ts Predict the output new What does this program print? Model alternatives with unions, combine constraints with intersections, and keep compositions safe through narrowing, discriminants, and never checks. ts Review AI code new Review a generated API result renderer Model alternatives with unions, combine constraints with intersections, and keep compositions safe through narrowing, discriminants, and never checks. ts Spot the bug new Spot the bug in ImportedUser Model alternatives with unions, combine constraints with intersections, and keep compositions safe through narrowing, discriminants, and never checks. ts Quiz new Which statement about an object union A | B is correct under structural typing? Model alternatives with unions, combine constraints with intersections, and keep compositions safe through narrowing, discriminants, and never checks. ts Quiz new Why enable exactOptionalPropertyTypes for a patch type built with Partial? Derive contracts with Partial, Pick, Omit, Record, and function utilities without confusing shallow types for runtime behavior. ts Quiz new A function returns an existing Account object under the type Omit<Account, "passwordHash"… Derive contracts with Partial, Pick, Omit, Record, and function utilities without confusing shallow types for runtime behavior. ts Predict the output new What does this program print? Derive contracts with Partial, Pick, Omit, Record, and function utilities without confusing shallow types for runtime behavior. ts Review AI code new Review a generated account update boundary Derive contracts with Partial, Pick, Omit, Record, and function utilities without confusing shallow types for runtime behavior. ts Spot the bug new Spot the bug in PublicAccount Derive contracts with Partial, Pick, Omit, Record, and function utilities without confusing shallow types for runtime behavior.
No practice items match these filters.