Languages · 14 concepts
TypeScript
Types that model your data exactly, so bugs show up in the editor, not in production.
Asked in these mock interviews
Part 1 · 4 concepts
How TypeScript thinks
- 01
Types, interfaces and structural typing
TypeScript checks the shape of a value, not its name; type and interface both describe shapes, but only interfaces merge and only type aliases can name unions and other…
- 02
any vs unknown vs never
unknown is the safe 'could be anything' type you must narrow before use, any switches checking off, and never is the type with no values, used for impossible cases and…
- 03
Narrowing and type guards
Narrowing is how TypeScript follows your runtime checks (typeof, instanceof, in, equality, truthiness, custom guards) to a more specific type inside each branch.
- 04
Discriminated unions for real UI states
Model states that cannot happen together as a union of objects with a shared literal tag (status: 'idle' | 'loading' | 'success' | 'error'), so impossible combinations…
Part 2 · 5 concepts
Generics and type-level tools
- 05
Generics and constraints
A generic is a type parameter that keeps the relationship between inputs and outputs (e.g. first<T>(xs: T[]): T | undefined), and extends constrains what can be passed…
- 06
keyof, typeof and indexed access
keyof T gives the union of T's keys, typeof value turns a value into its type, and T[K] reads a property's type, so you can derive types from one source of truth…
- 07
Mapped types, key remapping and template literal types
A mapped type builds a new object type by looping over keys ({ [K in keyof T]: ... }), with modifiers (?, readonly, -?) and as for renaming keys, often with template…
- 08
Conditional types and infer
A conditional type picks a type by a test (T extends U ? X : Y), distributes over unions when T is a naked type parameter, and infer pulls a type out of another type…
- 09
Utility types and implementing them
Built-in utilities (Partial, Required, Readonly, Pick, Omit, Record, ReturnType, Parameters, Awaited, NonNullable, Extract, Exclude) are small mapped or conditional…
Part 3 · 5 concepts
TypeScript in real projects
- 10
satisfies, as const, enums and assertions
as const keeps literal types and makes values readonly, satisfies checks a value against a type without widening it, and as assertions skip checks, so they are the last…
- 11
Typing functions, overloads and this
Function types describe parameters and return values; overloads give several call signatures for one implementation; optional and rest parameters, and callback typing…
- 12
Typing React components and hooks
Type props as an object type, children as React.ReactNode, events with React's event types, refs with useRef<HTMLDivElement>(null), and make reusable components generic…
- 13
Types vanish at runtime: validating API data
Types are erased, so data from an API, localStorage or a form is unknown at runtime; validate it with a schema (zod, valibot) and derive the type from the schema so the…
- 14
tsconfig, strict mode, declaration files and TypeScript 7
strict turns on the checks that catch real bugs (strictNullChecks, noImplicitAny and more); .d.ts files describe JS libraries; and TypeScript 7 (July 2026) is the…
Your first interview is free
Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.