Programming Languages10 lessons32 quiz questions
TypeScript
This plan focuses on the TypeScript features that matter most in interviews and production: the type system, generics, utility types, type narrowing, and strict mode. Sessions progress from basic annotations to advanced type-level programming. Skipped: TypeScript decorators (still...
What You Will Learn
- ✓TypeScript Mental Model and Setup
- ✓Types, Interfaces, Union and Intersection Types
- ✓Generics
- ✓Built-in Utility Types
- ✓Type Narrowing and Type Guards
- ✓Strict Mode and Compiler Configuration
- ✓Conditional Types, Mapped Types, Template Literals
- ✓Declaration Files and Module Augmentation
- ✓TypeScript with React and Node.js
- ✓Interview Simulation and Advanced Patterns
Overview
This plan focuses on the TypeScript features that matter most in interviews and production: the type system, generics, utility types, type narrowing, and strict mode. Sessions progress from basic annotations to advanced type-level programming.
Skipped: TypeScript decorators (still experimental), namespaces (legacy), tsserver plugin development, and compiler API. These are niche topics that rarely appear in standard interviews.
TypeScript Mental Model and Setup
TypeScript is a typed superset of JavaScript that compiles to plain JavaScript. The key mental model: TypeScript exists only at compile time. At runtime, it's JavaScript — all type information is erased.
Why TypeScript Exists
The Type System at a Glance
TypeScript's type system is structural (duck typing), not nominal (name-based). A type is compatible with another if it has all the required properties.
Basic Types
tsconfig.json Essentials
Type Inference
TypeScript infers types — you don't always need to annotate:
Interview Q&A
Q: What is the difference between and ?
A: Both can hold any value. The difference is what you can do with them. bypasses all type checking — you can call methods, access properties, pass it anywhere without error. requires you to narrow the type (via type guards, instanceof, typeof) before using it. is the type-safe alternative to for truly unknown values.
Q: Is TypeScript a runtime type system?
A: No. TypeScript's type system is entirely compile-time. After compilation, all type annotations, interfaces, and generics are erased. At runtime, you have plain JavaScript. This means TypeScript cannot validate data from external sources (APIs, databases) at runtime — you need runtime validation libraries like Zod or io-ts for that.
Q: What does enable?
A: It enables a group of strict checks: (null/undefined not assignable to other types), , , , , , and . The most impactful is — without it, and can be assigned to any type, defeating much of TypeScript's safety.
Common Mistakes
Python Implementation
Java Implementation
Sample Quiz Questions
1. What is the difference between type and interface in TypeScript?
Understand·Difficulty: 2/5
2. What does Partial<T> do?
Remember·Difficulty: 1/5
3. Implement MyPartial<T> from scratch using mapped types.
Analyze·Difficulty: 4/5
+ 29 more questions available in the full app.
Related Topics
Master TypeScript for Your Next Interview
Get access to full lessons, adaptive quizzes, cheat sheets, code playground, and progress tracking — completely free.