Back to Tech Interviews

TypeScript Interview Master

Curated 25+ essential TypeScript questions covering interfaces, type guards, generics, utility types, and advanced mapped types.

Total: 25 QuestionsLearned: 0 / 25 (0%)
Difficulty Filters

Tools & Options
Showing 25 of 25 questions
Beginner
What is TypeScript, and how is it different from JavaScript?

TypeScript is a strongly-typed, open-source programming language developed by Microsoft that acts as a strict syntactical superset of JavaScript. Unlike JavaScript, TypeScript checks code structures at compile-time and outputs standard JavaScript files, providing features like type safety, interfaces, static typing, and IDE auto-completion.

Beginner
Explain the difference between `interface` and `type` alias.

Both interfaces and type aliases can define shapes of objects. However, `interface` is open-ended and supports declaration merging (defining same interface multiple times appends fields), and can be extended with `extends`. A `type` alias is closed, can represent primitive unions, intersections, and tuples, but cannot be re-declared to merge properties.

// Interface declaration merging
interface User { name: string; }
interface User { age: number; } // Now User has both name & age

// Type union
type Status = 'active' | 'inactive';
Beginner
What are generics in TypeScript?

Generics allow developers to create reusable components, functions, or classes that work with multiple types rather than a single typed definition. They allow users to pass the type argument dynamically while maintaining type safety.

function identity<T>(arg: T): T {
  return arg;
}

let output1 = identity<string>("hello");
let output2 = identity<number>(100);
Intermediate
What is the difference between `any` and `unknown` types?
Beginner
What are union and intersection types?
Intermediate
What is Type Narrowing / Type Guards?
Intermediate
How do you define a custom type guard in TypeScript?
Intermediate
What does the `keyof` operator do?
Beginner
What are utility types? List some common ones.
Intermediate
Explain the `Pick` and `Omit` utility types.
Intermediate
What is the difference between `never` and `void`?
Beginner
What is an enum in TypeScript, and how is it used?
Beginner
What is a Tuple type?
Intermediate
What is type assertion, and how does it differ from type casting?
Beginner
What is the non-null assertion operator?
Beginner
What is the `readonly` modifier in TypeScript?
Intermediate
Explain index signatures in TypeScript.
Advanced
What are conditional types in TypeScript?
Advanced
Explain the `infer` keyword in conditional types.
Advanced
What are mapped types in TypeScript?
Advanced
Explain template literal types.
Intermediate
What is structural typing in TypeScript?
Beginner
What is strict mode in TypeScript?
Scenario
How do you type React components and events in TypeScript?
Scenario
How do you declare types for external non-TypeScript JavaScript libraries?

Technical Interview Mastery Blueprint

Proven methodologies and frameworks to succeed in technical and architecture rounds.

1. The Engineering STAR Technique

When responding to architectural or situational questions, structure your answer using Situation, Technical Constraint, Action, and Measurable Result. Rather than jumping straight to syntax, articulate the business problem, why certain patterns (e.g. caching, queuing, immutability) were selected over alternatives, and what latency or throughput improvements were achieved.

2. Defending Architectural Trade-Offs

Senior interviewers evaluate how you weigh trade-offs. Always explain why you chose an approach: e.g., memory overhead vs CPU cycle speed, consistency vs availability (CAP theorem), or normalized schemas vs denormalized fast reads. Stating the drawbacks of your own proposal demonstrates maturity and production experience.

3. Clean Code & Edge-Case Proactivity

In live-coding rounds, communicate your thinking aloud before typing. State edge cases explicitly: null or undefined inputs, extreme boundary values, concurrency races, and network timeouts. Writing modular, well-named functions with deterministic unit tests separates junior candidates from staff-level engineers.

4. Antipatterns to Avoid

Avoid reciting memorized definitions without practical context. Never dismiss non-functional requirements such as security (CSRF, injection, token rotation), observability (logging, metrics), and accessibility (ARIA, semantic standards). Always ask clarifying scope questions before writing complex implementations.

Continuous learning: Practice daily, mark completed questions as learned, and revisit difficult concepts.Explore All Interview Tracks →

Explore Related Tools

Hand-picked utilities and calculators related to this tool.

Related Tools