Skip to content

TypeScript Core (Interview Prep)

A structured roadmap of the TypeScript fundamentals that matter most in frontend interviews. Start top-to-bottom.

Series: TypeScript Core

Progress: 0/27

Start here

TypeScript: types vs interfaces (When to Use Which)

A deep, interview-ready guide to TypeScript types vs interfaces: extension, unions, intersections, declaration merging, and practical patterns for real codebases.

How to Study the TypeScript Core Track

In modern frontend teams, TypeScript is evaluated as an API design and safety tool rather than a syntax checklist. Interviewers look for engineers who know how to model domain invariants with discriminated unions, narrow unknown external payloads at runtime boundaries, and write reusable generic utilities without falling back to any or unsafe type assertions.

This roadmap progresses from structural typing fundamentals (types vs interfaces, any vs unknown vs never, and control-flow narrowing) to production-grade patterns including conditional types with infer, template literal types, branded types for IDs and currency, polymorphic React component props, and strict tsconfig compiler flags.

What Interviewers Evaluate in This Track

  • Modelling state machines and asynchronous UI states with exhaustive discriminated unions and never checks
  • Writing type-safe generic utilities, mapped types, and custom type predicates that preserve inference
  • Configuring noUncheckedIndexedAccess, exactOptionalPropertyTypes, and moduleResolution for production apps
  1. 1

    TypeScript: types vs interfaces (When to Use Which)

    ~22 min

    A deep, interview-ready guide to TypeScript types vs interfaces: extension, unions, intersections, declaration merging, and practical patterns for real codebases.

  2. 2

    TypeScript Generics: Basics, Constraints, and Real Patterns

    ~20 min

    A deep, interview-ready guide to TypeScript generics: why they exist, how inference works, constraints (extends), default generics, and practical examples used in real codebases.

  3. 3

    TypeScript Narrowing & Discriminated Unions (Interview-Ready)

    ~24 min

    A deep, interview-ready guide to narrowing in TypeScript: typeof, in, instanceof, user-defined type guards, and discriminated unions for safe, expressive code.

  4. 4

    TypeScript Utility Types: Pick, Omit, Partial, Record (Practical Guide)

    ~22 min

    A deep, interview-ready guide to TypeScript utility types: Pick/Omit/Partial/Required/Readonly/Record, common patterns, and how to avoid over-complicating types.

  5. 5

    any vs unknown vs never (Interview-Ready)

    2 min read

    How to choose any/unknown/never, why unknown is safer, and how never appears in narrowing and exhaustive checks.

  6. 6

    Type Guards & Narrowing Patterns

    1 min read

    How narrowing works in TypeScript: typeof/in, custom type guards, assertion functions, and practical patterns for safer code.

  7. 7

    The `satisfies` Operator (Why It’s a Big Deal)

    1 min read

    How `satisfies` helps validate shapes without losing literal types, and why it often beats `as const` and type annotations.

  8. 8

    Conditional Types + infer (Interview Essentials)

    1 min read

    Understand conditional types, infer, and how TypeScript extracts types from functions/promises/arrays.

  9. 9

    TypeScript Declaration Merging: Examples & Common Errors

    4 min read

    Learn TypeScript declaration merging with working interface and module augmentation examples, common compiler errors, and an interview exercise.

  10. 10

    tsconfig.json: The Settings That Matter

    1 min read

    A practical guide to TS compiler options interviewers ask about: strict, noImplicitAny, lib, moduleResolution, jsx, and incremental builds.

  11. 11

    Enums vs Union Types (and const enums)

    1 min read

    When to use enums, when to prefer string unions, and what const enums change.

  12. 12

    Typing React Components in TypeScript (Practical Patterns)

    3 min read

    Props, children, event handlers, generic components and polymorphic `as` props in React + TypeScript, with the pitfalls interviewers ask about.

  13. 13

    Mapped Types, keyof, and Template Literal Types (Interview-Ready)

    1 min read

    How keyof + mapped types work, and how template literal types unlock powerful typed APIs.

  14. 14

    Advanced Generics: Overloads, Inference Tricks, and Variance

    2 min read

    Interview-focused advanced generics: overloads, inference patterns, variance basics, and designing ergonomic typed APIs.

  15. 15

    package.json exports + Types: Designing a Clean Public API

    2 min read

    How to structure multi-entry TypeScript packages with package.json exports, prevent deep imports, and ship correct .d.ts for consumers.

  16. 16

    moduleResolution: NodeNext vs Bundler (and Why It Breaks Builds)

    3 min read

    How TypeScript resolves imports in modern toolchains, when to use NodeNext vs bundler, and how flags like verbatimModuleSyntax affect real projects.

  17. 17

    Path Aliases That Don’t Break Production (@/ Without Regret)

    3 min read

    How to use tsconfig paths safely across Next.js, bundlers, Node scripts, and tsc builds—without ‘works locally, fails in prod’.

  18. 18

    Conditional Exports (node/browser) + Correct Types

    3 min read

    How to publish different entry points for Node vs browser (or edge) using package.json exports conditions, without breaking TypeScript consumers.

  19. 19

    Strongly Typed pipe()/compose() (Variadic Tuples vs Overloads)

    2 min read

    How to type function pipelines like a library author: overloads, variadic tuples, inference boundaries, and what interviewers really want to see.

  20. 20

    Template Literal Types for Safe Routes, Events, and Keys

    2 min read

    Use template literal types to make strings type-safe: route patterns, event names, CSS variables, and i18n keys—with realistic examples.

  21. 21

    Branded Types: Safer IDs, Money, and Domain Values

    2 min read

    Use branded (nominal-ish) types to prevent mixing IDs and domain values, and learn safer alternatives to ‘just cast it’.

  22. 22

    unknown → Safe Types: Runtime Validation Patterns

    2 min read

    Stop lying with `as`. Learn production patterns to convert unknown data (fetch, localStorage, env) into safe TypeScript types with guards and assertions.

  23. 23

    satisfies: Enforce Shape Without Losing Literal Types

    2 min read

    Use the satisfies operator to validate objects (routes, feature flags, configs) while preserving literals for great inference and fewer casts.

  24. 24

    Bug-Catching TS Flags: noUncheckedIndexedAccess & exactOptionalPropertyTypes

    2 min read

    Two TypeScript options that catch real production bugs: safer indexing and optional properties that behave like you think.

  25. 25

    Typed Forms Without Pain (Mapped Types + Generic Helpers)

    2 min read

    A production-friendly pattern to type form values, errors, and validators using mapped types—no giant unions, no any.

  26. 26

    Type-Level Testing + Public API Design (Library Author Mindset)

    3 min read

    How to keep TypeScript APIs stable: test your types, design exports intentionally, and avoid leaking internals that you can’t maintain.

  27. 27

    Scaling TypeScript: Project References, Composite Builds, and Fast CI

    2 min read

    How large TypeScript codebases stay fast: project references, composite builds, incremental compilation, and clean boundaries.