TypeScript / Type System Interview Questions 2026

Published July 22, 2026 · Updated July 22, 2026

15 TypeScript / Type System interview questions from General, Amazon, TCS, Microsoft and more. Real questions from Technical, System Design, and HR rounds.

15 questions
Companies: General, Amazon, TCS, Microsoft

All TypeScript / Type System Questions

Amazon Hard System Design round 4-7 years

Your team wants to adopt TypeScript but has a 200K-line JavaScript codebase. What's the migration strategy?

↑ 81 upvotes · 9 engineers asked this · SDE2
Amazon Hard Technical round 3-6 years

You have a TypeScript generic function that takes an object and a key. It should return the value at that key in a type-safe way so callers get proper autocomplete. Write the function signature.

↑ 62 upvotes · 10 engineers asked this · SDE2
General Medium Screening round 2-5 years

Explain the difference between 'unknown' and 'any' in TypeScript. When would using 'any' be a valid technical choice rather than a code smell?

↑ 61 upvotes · 9 engineers asked this · SDE2
General Hard Technical round 3-6 years

You have a TypeScript function that accepts a union type of 10 different shapes. You use instanceof checks that work in tests but fail in production after webpack bundling. Why?

↑ 60 upvotes · 8 engineers asked this · SDE2
General Hard Screening round 4-7 years

What is declaration merging in TypeScript and what problems can it solve?

↑ 59 upvotes · 7 engineers asked this · SDE2
TCS Medium Screening round 2-5 years

Your TypeScript codebase has many 'as any' casts. A new developer says 'it's just to make the code compile.' What's the real cost?

↑ 58 upvotes · 6 engineers asked this · SDE2
Amazon Hard Technical round 4-7 years

Explain TypeScript's conditional types. Write one that extracts the return type of a Promise.

↑ 57 upvotes · 5 engineers asked this · SDE2
TCS Medium Screening round 2-5 years

What is the difference between TypeScript's interface and type alias? When would you use each?

↑ 56 upvotes · 4 engineers asked this · SDE2
General Hard Screening round 3-6 years

Explain TypeScript's structural typing. How does it differ from nominal typing and why does it sometimes cause unexpected behavior?

↑ 55 upvotes · 3 engineers asked this · SDE2
Microsoft Medium Technical round 2-5 yearsTypeScript

Explain the difference between a TypeScript interface and a type alias. Give a concrete case where only one of them can express what you need.

↑ 36 upvotes · 28 engineers asked this · Senior SDE
General Hard Technical round 3-6 years

Your TypeScript code compiles fine but throws 'Cannot read property X of undefined' at runtime. How is this possible in a strictly typed TypeScript codebase?

↑ 9 upvotes · 17 engineers asked this · SDE2
Amazon Hard Technical round 4-7 years

What are TypeScript conditional types? Write a type that returns the element type of an array, or the type itself if not an array.

↑ 8 upvotes · 16 engineers asked this · SDE2
TCS Hard System Design round 4-8 years

You're migrating a large JavaScript codebase to TypeScript. You have 500 files. What's your migration strategy to avoid a big-bang rewrite?

↑ 7 upvotes · 15 engineers asked this · SDE2
General Medium Screening round 2-5 years

Explain the TypeScript utility types: Partial<T>, Required<T>, Pick<T,K>, Omit<T,K>, and Record<K,V>. Give a real use case for each.

↑ 6 upvotes · 14 engineers asked this · SDE2
General Medium Technical round 2-5 years

You have a TypeScript codebase where a function returns string | undefined. Throughout the codebase, developers use the ! non-null assertion operator everywhere. Why is this a code smell?

↑ 5 upvotes · 13 engineers asked this · SDE2

Practice these questions with AI feedback

Get instant grading on your answers, identify your weak areas, and generate a personalised 14-day study plan — all free.

Build my study plan →

Same topic at specific companies

General TypeScript / Type System Amazon TypeScript / Type System TCS TypeScript / Type System Microsoft TypeScript / Type System

Related topics

DSA / Arrays System Design DSA / Trees DSA / Graphs Behavioral Testing Domain DevOps API Testing DSA / Hashmaps GCP / Real-time Data Java / Pub-Sub React / Performance Node.js / Memory SQL / Query Optimization Python / Async AWS / Lambda Kafka / Consumer Microservices / Saga Pattern MongoDB / Indexing Security / SQL Injection Performance / Latency Tail Redis / Cache Stampede Elasticsearch / Cluster Health GraphQL / Security Data Engineering / Exactly Once Snowflake / Architecture PySpark / Core Concepts Airflow / Scheduling Web / WebAssembly Debugging / Production JavaScript / V8 Engine

Frequently asked questions

Your team wants to adopt TypeScript but has a 200K-line JavaScript codebase. What's the migration strategy?
Your team wants to adopt TypeScript but has a 200K-line JavaScript codebase. What's the migration strategy?
You have a TypeScript generic function that takes an object and a key. It should return the value at that key in a type-safe way so callers get proper autocomplete. Write the function signature.
You have a TypeScript generic function that takes an object and a key. It should return the value at that key in a type-safe way so callers get proper autocomplete. Write the function signature.
Explain the difference between 'unknown' and 'any' in TypeScript. When would using 'any' be a valid technical choice rather than a code smell?
Explain the difference between 'unknown' and 'any' in TypeScript. When would using 'any' be a valid technical choice rather than a code smell?
You have a TypeScript function that accepts a union type of 10 different shapes. You use instanceof checks that work in tests but fail in production after webpack bundling. Why?
You have a TypeScript function that accepts a union type of 10 different shapes. You use instanceof checks that work in tests but fail in production after webpack bundling. Why?
What is declaration merging in TypeScript and what problems can it solve?
What is declaration merging in TypeScript and what problems can it solve?