Skip to the page

TypeScript · Concept

What TypeScript gives you; type vs interface

The interviewer asks

What is TypeScript and what are its features? When do you use type vs interface?

Then

Follow-ups the interviewer asks next

  1. Declaration merging (interfaces only); module augmentation for third-party types.
  2. Unions, mapped and conditional types need type.
  3. extends vs intersection: error messages and performance.
  4. TS types are erased at runtime, so how do you validate API data? (zod/valibot.)

The answer

What a strong answer covers

  • Static typing, inference, tooling and refactoring safety; no runtime checks
  • Prefer interface for object shapes and public APIs (extendable), type for unions and compositions; be consistent

The red pen

Common traps

Avoid:"TypeScript makes the app safer at runtime".

Practise this out loud

Say your answer out loud to an AI interviewer that follows up, and get a score for it.

Practise by voice

Practise questions like this out loud

Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.

Start your free interview