TypeScript Developer Interview Guide

TypeScript Interview Questions

Screen TypeScript developers on type system depth, inference, generics, narrowing, and pragmatic application across frontend and backend codebases.

Strong TypeScript candidates use the type system to make incorrect states unrepresentable, not to chase clever tricks. These prompts focus on real-world judgment around inference, generics, and migration.

Book A Demo
Section 1

Type System

Test understanding of structural typing, narrowing, unions, and discriminated types.

1. Design types for an API response that can be loading, error, or success with data.

Interview prompt

Strong signal

Uses discriminated union, narrows with kind/status, avoids optional chaining everywhere.

Follow-up probes

  • How would you handle pagination?
  • How does this play with React state?

Red flags

  • Uses any or unknown without narrowing.
  • Models all states with optional fields.
Section 2

Generics

Check whether candidates can write generic helpers without sacrificing inference.

1. Write a typed function that takes an array and a key, and returns a record indexed by that key.

Interview prompt

Strong signal

Uses keyof, generic constraints, and preserves inference at call sites.

Follow-up probes

  • What if the key is not unique?
  • How would you handle nested keys?

Red flags

  • Loses inference by typing inputs as any.
  • Cannot explain why constraints help.
Section 3

Migration

Evaluate judgment when adding TypeScript to existing JavaScript codebases.

1. Your team is migrating a large JavaScript codebase to TypeScript. How would you sequence the work?

Interview prompt

Strong signal

Discusses incremental adoption, allowJs, strict flags, codemods, and risk areas.

Follow-up probes

  • When would you avoid migrating a file?
  • How do you track progress?

Red flags

  • Suggests a big-bang rewrite.
  • No plan for type assertions or any.

Hire better with structured interviews

Access our full question library and automate your evaluation workflow today.