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
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.
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.
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.
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.
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.
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.
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.
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.