TypeScript Interview Questions and Answers

TypeScript interview questions

Use these TypeScript interview questions to assess developers on the type system, generics, narrowing, utility types and project setup.

Short answer: A good TypeScript interview tests types and interfaces, unions and narrowing, generics, utility types, strict settings and typing real APIs. Add a short typing task.

How to Use These Questions

Pick 6 to 8 questions that match the role level. Ask follow-ups on real trade-offs, not definitions. Score each answer from 1 to 4 against the “strong answer” column.

TypeScript Interview Questions by Level

Junior

QuestionWhat a strong answer covers
type vs interface?Extending, merging, unions; when each fits
What does strict mode do?strictNullChecks, noImplicitAny, safer code
What is any vs unknown?unknown forces checks; any turns checks off
How do you type a function?Parameters, return types, optional and default values

Mid-level

QuestionWhat a strong answer covers
How does type narrowing work?typeof, in, instanceof, discriminated unions
How do you write a generic function?Type parameters, constraints, inference
Which utility types do you use?Partial, Pick, Omit, Record, ReturnType
How do you type API responses?Shared types, runtime validation with Zod

Senior

QuestionWhat a strong answer covers
How do you design types for a large codebase?Domain types, branded types, avoiding over-engineering
What are conditional and mapped types?Type-level logic for reusable patterns
How do you migrate JavaScript to TypeScript?Gradual strictness, allowJs, typing the edges first
How do you keep builds fast?Project references, incremental builds, isolated modules

A Practical TypeScript Task

Give a 45-minute task: type a small API client with generics, a discriminated union for results and runtime validation.

Red Flags in a TypeScript Interview

  • Uses any everywhere
  • Turns off strict mode
  • Casts with as to silence errors
  • No runtime validation for external data

Interview Scorecard

Area1 – weak4 – strong
BasicsWeakClear types and interfaces
GenericsAvoids themUses them well
SafetyCasts and anyNarrowing and validation
ScaleUnknownConfig and project structure

Hire Vetted TypeScript Talent Without Running Every Interview

Staffenza runs five vetting steps for you: CV and portfolio review, technical assessment, live technical interview, English check and references. Remote engineers from India or Pakistan cost USD 225 a month on top of salary. In the UAE and Saudi Arabia, direct hire costs 15–20% of the first-year package, with a 3-month replacement guarantee.

The Bottom Line

Good TypeScript developers use the type system to prevent bugs, not to silence them. Test that with a typing task.

Related: TypeScript developers, Node.js interview questions, Angular interview questions, all interview question guides.

Ready to hire? Email [email protected] or use our contact page.

TypeScript Interview FAQs

How many TypeScript questions should I ask?

Ask 6 to 8 questions in a 60-minute interview, plus a short practical task.

Take-home task or live coding?

A short take-home followed by a live review shows real work and reasoning.

Can candidates use AI tools?

Decide up front. If allowed, ask candidates to explain and change the code they submit.

How does Staffenza vet TypeScript developers?

Every candidate passes CV review, a technical assessment, a live technical interview, an English check and references.