TypeScript Interview Questions and How to Answer Them
By Aaron Cao · Updated

TypeScript interviews test the type system rather than syntax: structural typing, the difference between any and unknown, generics with constraints, and narrowing. Expect a live round where you add types to existing JavaScript, plus follow-ups on strict mode and why types vanish at runtime.
What do TypeScript interviews actually test?
If you have shipped TypeScript for a year and still feel unready for the interview, the gap is usually not syntax. This section covers what interviewers are really probing, which is whether you understand the type system as a system rather than as annotations you add until the red squiggles stop.
Three themes carry most interviews. The first is what the compiler knows and when: inference, narrowing, and the fact that every type disappears before your code runs. The second is composition: generics, unions, and the utility types built on keyof and mapped types. The third is judgment, which is where senior candidates separate themselves. Knowing that any exists is table stakes; being able to say where you would accept it and where you would reach for unknown and a runtime check is the answer they remember.
Framework questions ride along with all of this. React roles ask about typing props, hooks, and event handlers. Node roles ask about typing request handlers and third-party modules that ship no types of their own.
Which type-system questions come up most?
These recur across companies and levels, and each one has a follow-up waiting behind it.
- What is the difference between
interfaceandtype? Interfaces merge across declarations and read naturally for object shapes. Type aliases express unions, tuples, mapped and conditional types. Follow-up: which would you use for a public library surface, and why. - How do
any,unknown, andneverdiffer?anyturns checking off,unknownaccepts anything but makes you narrow before you touch it, andneveris the type with no values. Follow-up: hownevergives you an exhaustiveswitch. - What is structural typing? Compatibility is decided by shape, not by which interface a value was declared against. Follow-up: how to get nominal behavior back with a branded type.
- How does narrowing work?
typeof,instanceof,in, truthiness, discriminated unions on a literal tag, and user-defined predicates of the formx is Foo. Follow-up: why a predicate you wrote badly is a silent lie to the compiler. - Explain generics with constraints. A parameter bounded by
extendslets a function stay general while still accessing known members. Follow-up: writePickorOmitfrom scratch. - What does
strictactually enable? NamestrictNullChecksandnoImplicitAnyat minimum, and be ready to describe migrating a codebase into strict mode file by file.
Newer material shows up at senior level: the satisfies operator for checking a value against a type without widening its inferred type, and as const for literal types. More role-specific banks are collected in the question library.
What does the live coding round look like?
The common format is a small JavaScript module handed to you untyped, with a request to type it properly in twenty or thirty minutes. The module usually hides two traps: a function whose return type depends on its argument, and an API response the code trusts without checking.
A frontend engineer interviewing for a senior role at a logistics company was given a fetch wrapper and a render function. She typed the wrapper generically, then said plainly that the generic was a promise the compiler could not keep, because nothing validated the response at runtime, and she added a narrow guard before the parsed data crossed into typed code. That sentence about erasure was what moved the interview forward, not the annotations.
Talk while you type. Say why you reach for a union instead of an enum, why you are not exporting a type, why one any is staying with a comment on it. Silent correct code scores below noisy correct code in almost every rubric, and the habit is worth rehearsing on the mock interview page before the real round.
How do you practice answering these out loud?
Reading type-system explanations builds recognition, not recall. The interview asks for a definition in your own words in about thirty seconds, and that is a different skill. Pick six questions from the list above and answer each one aloud, timed, without notes.
Run the same set again a day later, because the ones you lose are the ones you learn. A mock interviewer that asks the follow-up rather than accepting the first answer is what makes this work; setup is on the tutorial page.
For the live interview itself, an assistant that listens to the interviewer and suggests structure can help when a question arrives from a corner of the language you use rarely. It works on desktop meeting clients and in a browser tab, and it does not join the call as a participant. It is out of scope on a proctored assessment platform, on a recorded screen share, or on a company-managed laptop, so the questions you can answer cold are the ones that count.
FAQ
Do I need to know conditional types and infer?
Should I say I avoid any completely?
Are enums still asked about?
How much JavaScript gets asked in a TypeScript interview?
What should I do if a type error stumps me during the round?
Related questions
- What C++ questions get asked in interviews?
- What questions get asked in a non-profit job interview?
- What Copilot and AI coding assistant questions do developers get asked in interviews?
- What questions get asked in a second interview?
- What questions are asked in a product designer interview?
- What questions are asked in a full stack developer interview?