TypeScript Deep-Dive Quiz

30 questions across 3 levels — covering compilation, type theory, and industry best practices. Each answer explains why, what TypeScript compiles to, and what the pros do.

Based on the TypeScript Handbook & common interview questions · Keyboard: 1–4 to answer · Enter/→ to advance · Tab to switch tabs

What the TypeScript interview quiz covers

This quiz works through the parts of TypeScript that interviewers actually probe: how the compiler infers types when you do not annotate them, how generics let a function stay type-safe across many input shapes, and how the type system computes new types from existing ones with conditional types, mapped types, and the infer keyword. It also covers narrowing — how TypeScript uses control flow, typeof, instanceof, discriminated unions, and user-defined type guards to shrink a union down to a single type inside a branch.

A distinctive feature is that every answer includes the compiled JavaScript. Types, interfaces, and type-only imports are erased at build time and produce no runtime code, while enums, class parameter properties, and decorators do emit something. Seeing the emitted output next to the source makes it obvious which constructs are purely a compile-time contract and which carry a runtime cost — a distinction that comes up constantly in interviews about bundle size and performance.

The utility types — Partial, Required, Readonly, Pick, Omit, Record, ReturnType, Parameters, Awaited, and the rest — are treated as things you should be able to reimplement, not just call. Several questions ask you to predict the result of a hand-written mapped type that mirrors one of the built-ins, which is a common whiteboard exercise.

Difficulty levels

Beginner covers the everyday type system: primitive and literal types, arrays and tuples, union and intersection types, interfaces versus type aliases, optional and readonly properties, function types, and the difference between any, unknown, and never. These are the questions a screening call is most likely to open with.

Intermediate moves into generics with constraints, keyof and indexed access types, typeof used as a type query, basic mapped and conditional types, and control-flow narrowing. Advanced pushes into recursive conditional types, the infer keyword, template literal types, variadic tuple types, the satisfies operator, const type parameters, NoInfer, and module augmentation — the material that distinguishes a senior TypeScript answer.

Topics in the question bank

How to use the TypeScript quiz

  1. Pick a level — Beginner, Intermediate, or Advanced — from the start screen. You can take them in any order and retake each as many times as you want.
  2. Answer each multiple-choice question. Use the number keys 1 to 4 to select and Enter or the right arrow to advance.
  3. After answering, read the three explanation tabs: Why This Answer, Compiled JS, and Best Practice. The Compiled JS tab shows exactly what the TypeScript compiler emits for that snippet.
  4. Review your score at the end, then retake the level a day later to check what actually stuck.

TypeScript interview quiz FAQ

How many TypeScript interview questions are there?

There are 30 questions in total — 10 Beginner, 10 Intermediate, and 10 Advanced. Each level is shuffled on every playthrough, so you get a fresh order each time.

What topics does the TypeScript quiz cover?

It covers type inference, any versus unknown, interfaces versus type aliases, optional properties, generics and constraints, keyof and indexed access types, mapped types, conditional types, the infer keyword, discriminated unions, template literal types, variadic tuples, satisfies, NoInfer, const type parameters, and module augmentation.

Are these questions for junior or senior roles?

Both. The Beginner level matches a first frontend or full-stack role, Intermediate matches a mid-level engineer, and Advanced reflects what a senior or staff engineer is expected to explain confidently. Working through all three in order is the most useful approach.

Does the quiz show compiled JavaScript output?

Yes. Every question has a Compiled JS tab showing exactly what TypeScript emits after erasing type annotations. It makes clear which constructs have a runtime cost and which are purely compile-time.

Is this enough on its own to prepare for a TypeScript interview?

It is a strong knowledge check, but pair it with hands-on practice: build something small with strict mode on, read the compiler errors carefully, and practise saying each answer out loud. Interviews test explanation as much as recognition.

Do I need an account to take the quiz?

No. The quiz is completely free with no account, login, or download. Everything runs in your browser and no answers or scores are sent anywhere.