Types that pay for themselves
TypeScript Interview Questions
Inference, generics, narrowing, utility types and migration patterns for TypeScript that stays maintainable.
40 questions10 easy22 medium8 hard0/40 learned
01What is TypeScript and what does it add to JavaScript?Easytypescript · static-typing · compiler02How does TypeScript differ from JavaScript?Easytypescript · javascript · comparison03How does type inference work in TypeScript?Easyinference · widening · type-system04When should you add type annotations?Easyannotations · typescript · api-design05What is the difference between interfaces and type aliases?Mediuminterfaces · type-aliases · declaration-merging06What are union types and how do you use them safely?Easyunions · narrowing · type-system07What are intersection types?Mediumintersections · composition · type-system08What are literal types and when are they useful?Easyliteral-types · const-assertion · state09How do enums work and when should you use them?Mediumenums · runtime · state10What are generics and why are they useful?Mediumgenerics · reuse · type-parameters11What are generic constraints?Mediumgenerics · constraints · keyof12What does keyof do?Mediumkeyof · generics · mapped-types13How is typeof used as a type operator?Mediumtypeof · type-operators · inference14What are indexed access types?Mediumindexed-access · type-operators · keyof15What are mapped types?Hardmapped-types · type-operators · utility-types16How do conditional types work?Hardconditional-types · distributive · type-system17What does the infer keyword do?Hardinfer · conditional-types · type-extraction18What are template literal types?Hardtemplate-literal-types · string-types · key-remapping19Which utility types do you use most and why?Mediumutility-types · type-derivation · api-design20What is a type guard and when should you write one?Mediumtype-guards · narrowing · validation21How does type narrowing work?Mediumnarrowing · control-flow · unions22What is the difference between unknown and any?Mediumunknown · any · type-safety23What is the never type used for?Mediumnever · exhaustiveness · control-flow24When are type assertions appropriate?Hardassertions · as-const · type-safety25What are declaration files and when do you write one?Mediumdeclaration-files · ambient-types · packages26How do modules work in TypeScript?Mediummodules · imports · module-resolution27What does tsconfig.json control?Easytsconfig · compiler-options · tooling28What does strict mode enable and why does it matter?Mediumstrict · null-safety · compiler-options29How do decorators work in TypeScript?Harddecorators · metadata · classes30How do classes work in TypeScript?Easyclasses · parameter-properties · implements31What are abstract classes used for?Mediumabstract-classes · inheritance · classes32What do public, private, protected and readonly mean?Easyaccess-modifiers · encapsulation · classes33How do function overloads work?Mediumoverloads · functions · api-design34When should you use overloads instead of a union parameter?Hardoverloads · unions · api-design35What is a discriminated union?Mediumdiscriminated-unions · state · narrowing36How do you get exhaustiveness checking on a union?Mediumexhaustiveness · never · switch37How do you type React components with TypeScript?Mediumreact · props · typescript38How do you test TypeScript types?Hardtesting · type-level-tests · generics39How would you migrate a JavaScript codebase to TypeScript?Mediummigration · javascript · strict-mode40What TypeScript practices do you follow in production?Easybest-practices · strict · api-design
Reading is step one
Now say it out loud.
Understanding an answer and delivering it under pressure are different skills. Rehearse this topic in a live TypeScript mock interview and get scored feedback on depth, clarity and confidence.