</>Frontend Interviews

TypeScript interview questions and answer frameworks

Practice TypeScript interview questions about modeling, inference, narrowing, generics, runtime boundaries, migrations, and maintainable APIs.

A strong TypeScript answer explains which invalid states are removed, which runtime risks remain, and how another engineer will understand the resulting API.

01

Core model questions

  • How are `unknown`, `any`, and `never` different in an API?
  • When is a discriminated union better than optional fields?
  • How does control-flow narrowing work?
  • What does structural typing make easier or riskier?
  • How do generic constraints improve an API?
02

Practical API questions

  • Design the states of an asynchronous request.
  • Type an event map without losing event-specific payloads.
  • Model a form with conditional fields.
  • Create a type-safe adapter around untrusted JSON.
  • Evolve a shared function without breaking callers.
03

System questions

  • Where should runtime validation occur?
  • How should generated API types be consumed?
  • What is your strategy for strictness in a migration?
  • When can type assertions hide a design problem?
  • How do project references or package boundaries affect a large codebase?
04

Answer framework

  • State the product invariant.
  • Show the simplest readable type model.
  • Name the runtime boundary.
  • Discuss inference and call-site ergonomics.
  • Explain migration and testing consequences.
References

Primary sources

Use these primary references to verify the technical models behind this guide.

Editorial reviewProduct claims were checked against the current experience. Technical references use primary documentation where the guide depends on platform or framework behavior. Found an issue? Send a correction.

Turn the guide into a retry

Choose one section, practice it under interview conditions, review the evidence, and repeat the same skill with a new prompt. Improvement becomes reliable when it survives a different context.

Start a mock interview