What should you focus on for a TypeScript interview?
Which questions should you start with?
Start with type aliases versus interfaces, the most asked question in these interviews. It appeared in 10 of 45 interviews. Next came what TypeScript adds to JavaScript, followed by the problems generics solve.
Use these questions to check your answers:
- Can you explain what TypeScript adds to JavaScript and name errors it can catch?
- Can you show a generic function and explain the problem it solves?
- Can you compare
var,let, andconst, including scope and hoisting?
Look beyond individual questions, too. Unions and narrowing was the most common topic, appearing in 13 of 45 interviews. Can you explain how any, unknown, and never differ? Can you show how a type guard narrows a value?
What did reviewed answers leave out?
For type aliases versus interfaces, 3 of 6 reviewed answers missed a practical rule for choosing between them. The missing point was using interfaces for object contracts you need to extend, and type aliases for unions and other type expressions.
Check that your answer covers both the difference and the choice:
- Can you name an object contract you would define with an interface and explain how you would extend it?
- Can you show a union you would define with a type alias?
- Can you explain why you chose each approach?
What code should you be ready to write?
A coding task appeared in 9 of 45 interviews. Using a union type in a function was the most common task listed.
Try these checks before reading an answer:
- Can you write a function that uses a union type?
- Can you add an item to an array?
- Can you handle
nullin a TypeScript feature flag? - Can you type React button props so link mode and button mode are mutually exclusive?
Which applied topics should you review?
For React, check whether you can type component props, state, reducers, and refs. For a polymorphic component, can you support an as prop with the correct props and refs?
For API work, can you validate external data and handle a nullable response? For backend work, can you limit concurrent work and define types for batch results?
For code quality, can you explain how you would replace any with appropriate types? Include how you would prevent any from returning across the project, not just how you would remove it.
Who gets asked TypeScript
The 20 most asked TypeScript questions
Counted by interview, not by mention: a question asked twice in one conversation counts once.
What is the difference between type aliases and interfaces in TypeScript, and when would you use each?
Asked in 10 of 45 interviews · last asked Oct 8 · Concept · Mid-level
Show answer
Interfaces describe object shapes and support declaration merging. Type aliases can name any type, including objects, unions, and tuples. I prefer interfaces for extensible object contracts and type aliases for unions, such as component props with distinct variants.
- Both can describe component props and function signatures.
- Interfaces with the same name in the same scope merge; type aliases cannot be redeclared.
- Interfaces extend compatible object types; type aliases can combine types using intersections.
- Use a union type alias when different component variants require different props.
What the interviewer checks: The interviewer is checking whether you understand the differences and can choose based on the contract you need.
Common mistake (in 3 of 6 reviewed answers): Many answers forget that interfaces suit extensible object contracts, while type aliases suit unions and other type expressions.
Other ways it was asked
- “What is an interface in TypeScript?”
- “In TypeScript, what's the difference between type and interface, and when would you prefer one over the other in a UI component code base?”
- “In TypeScript, what's the difference between type and interface, and when do you prefer one over the other?”
What does TypeScript add to JavaScript, what benefits does it provide, and what errors can it catch?
Asked in 7 of 45 interviews · last asked Aug 25 · Concept · Junior
Show answer
TypeScript adds static type checking to JavaScript, with features like type annotations, interfaces, and generics. It catches many mistakes before code runs, such as wrong argument types, missing properties, and unsafe null access when strict null checks are enabled. It improves editor suggestions, navigation, and refactoring. Types are removed when compiling to JavaScript, so they do not validate runtime data.
- Type inference checks many values without explicit type annotations.
- Static checks catch type mismatches, but not every logic error or runtime failure.
- Strict settings catch more mistakes; any bypasses type checking.
- External data still needs runtime validation.
What the interviewer checks: The interviewer checks whether you understand static typing, tooling benefits, and the limits of compile-time checks.
Other ways it was asked
- “Why use TypeScript, and what benefits does it offer?”
- “Can you explain why TypeScript is useful and what tooling it adds?”
- “What does TypeScript add on top of JavaScript, and what tooling benefits does it provide?”
What problems do TypeScript generics solve, and can you show an example of a generic function?
Asked in 6 of 45 interviews · last asked Oct 7 · Concept · Junior
Show answer
TypeScript generics let you reuse code with different types while keeping type checks. A type parameter, such as T, connects types across inputs and outputs. This avoids writing separate functions for each type or using any, which loses type safety.
- Generics preserve type information instead of replacing it with any.
- TypeScript can often infer type arguments from the values you pass.
- Use extends to limit which types a generic accepts.
Codefunction identity<T>(value: T): T { return value; } const count = identity(42); // inferred as literal type 42 const label = identity<string>("hello"); // explicit string typeWhat the interviewer checks: The interviewer checks whether you can write reusable code that preserves relationships between types.
Other ways it was asked
- “What are generic types in TypeScript, and what is your understanding of them?”
- “How do you use generics in TypeScript?”
- “What are generics in TypeScript, why are they useful, and can you give an example?”
How do any, unknown, and never differ in TypeScript?
Asked in 4 of 45 interviews · last asked Oct 7 · Concept · Mid-level
Show answer
any turns off type checking for a value. unknown accepts any value, but you must narrow its type or use a type assertion before type-specific operations. never represents values that cannot exist, such as the return value of a function that always throws.
- Prefer unknown for untrusted input; check its type before using it.
- any lets unsafe operations pass type checking and can hide bugs.
- never supports exhaustive checks and describes functions that cannot return normally.
- Unlike never, void means a function returns no useful value.
What the interviewer checks: The interviewer checks whether you understand type safety, narrowing, and impossible values.
Other ways it was asked
- “What is the difference between the any and unknown types in TypeScript?”
- “What is the difference between any and unknown in TypeScript?”
- “What is the difference between `any`, `unknown`, and `never` in TypeScript?”
How do var, let, and const differ in TypeScript, including their scope and hoisting?
Asked in 3 of 45 interviews · last asked Oct 8 · Concept · Junior
Show answer
`var` has function scope, or module/global scope at the top level. `let` and `const` have block scope; only `let` allows reassignment. `var` is hoisted and initialized to `undefined`. `let` and `const` are hoisted but stay uninitialized until their declaration runs; earlier access throws a `ReferenceError` because of the temporal dead zone.
- `var` allows redeclaration; `let` and `const` cannot be redeclared in the same scope.
- `const` prevents reassignment, but object properties and array contents can still change.
- A normal `const` declaration requires an initializer.
- TypeScript follows JavaScript’s scope and hoisting rules for these keywords.
What the interviewer checks: The interviewer checks whether you understand scope, reassignment, and what happens when variables are accessed before declaration.
Other ways it was asked
- “What variable declaration types are available in JavaScript?”
- “What variable declaration keywords are available in JavaScript and TypeScript, and how do they differ?”
- “How does `var` work in TypeScript?”
What is type narrowing in TypeScript, and how do type guards help?
Asked in 3 of 45 interviews · last asked Oct 6 · Concept · Mid-level
Show answer
Type narrowing means TypeScript uses checks and control flow to work out a more specific type. Type guards are checks, such as `typeof` or `instanceof`, that help it narrow a type. They let you safely use properties or methods that only some possible types support.
- Common guards use typeof, instanceof, in, or checks against a specific value.
- Custom guard functions can return a type predicate, such as value is string.
- A custom guard must actually check what its type predicate claims.
- Narrowing changes the compiler’s view of a value, not the value itself.
Codefunction isString(value: unknown): value is string { return typeof value === "string"; } function format(value: string | number): string { if (isString(value)) return value.toUpperCase(); return value.toFixed(2); }What the interviewer checks: The interviewer is checking whether you can safely handle union or unknown types using checks rather than type assertions.
Other ways it was asked
- “What are type guards in TypeScript, and when would you use them?”
- “How would you write a type guard in TypeScript?”
- “What are type guards?”
What is a union type in TypeScript, and how would you use one in a function?
Asked in 3 of 45 interviews · last asked Oct 7 · Write code · Junior
Show answer
A union type lets a value be one of several types, written with `|`. A function can use a union parameter to accept different input types. Inside the function, use checks such as `typeof` to narrow the type before calling type-specific methods.
- Use `|` to combine types, such as `string | number`.
- Before narrowing, only operations valid for every member of the union are allowed.
- Type checks let TypeScript identify which type is safe to use.
Codefunction format(value: string | number): string { if (typeof value === "number") { return value.toFixed(2); } return value.trim(); } format(12.5); // "12.50" format(" hello "); // "hello"What the interviewer checks: The interviewer is checking whether you can accept multiple types and handle them safely using type narrowing.
Other ways it was asked
- “What is the name of a TypeScript type that allows a variable to have more than one type?”
- “Can you give an example of using union types in TypeScript in a function?”
- “What is a union type?”
How would you type a polymorphic React component with an as prop and correct props and refs?
Asked in 2 of 45 interviews · last asked Jul 19 · Concept · Senior
Show answer
I use a generic element type, then combine its props with the component’s own props. ComponentPropsWithRef includes the matching ref type. In React 19, I pass ref through as a prop. In React 18, I use forwardRef and give the exported component a generic call signature to preserve inference.
- Use React.ElementType for the generic constraint, with a default matching the default rendered element.
- Omit overlapping keys from inherited props so the component’s own props take priority.
- React.ComponentRef or React.ElementRef can infer the ref instance type.
- Custom components must accept and pass refs correctly; types alone cannot guarantee this.
Code// React 19, TypeScript with JSX import * as React from "react"; type Props<C extends React.ElementType = "button"> = { as?: C } & Omit<React.ComponentPropsWithRef<C>, "as">; function Box<C extends React.ElementType = "button">({ as, ...props }: Props<C>) { const Tag: React.ElementType = as ?? "button"; return React.createElement(Tag, props); } const linkRef = React.createRef<HTMLAnchorElement>(); const link = <Box as="a" href="/" ref={linkRef} />;What the interviewer checks: The interviewer checks whether the chosen element controls allowed props and ref types without losing generic inference.
Other ways it was asked
- “How would you type a reusable React component with an as prop so that when as is an anchor you get anchor props, and when as is a button you get button props, including correct ref types?”
- “How would you model a polymorphic React component in TypeScript?”
- “In a polymorphic React component typed with TypeScript, how do you ensure the ref type matches each rendered element, and which type utilities can infer the instance type?”
What are decorators in Angular?
Asked in 2 of 45 interviews · last asked Oct 15 · Concept · Junior
Show answer
Decorators in Angular are functions that add metadata to classes, properties, methods, or parameters. Angular uses this metadata to understand how to handle them. For example, @Component defines a component and its settings, while @Injectable marks a class for dependency injection.
- @Component provides settings such as a component’s selector and template.
- @Input and @Output define how a component receives data and sends events.
- @Directive defines a directive; @Pipe defines a template value transformation.
- @NgModule defines an Angular module; standalone components do not need an NgModule declaration.
What the interviewer checks: The interviewer checks whether you understand decorator metadata and can name common Angular decorators and their purposes.
Other ways it was asked
- “What is a decorator in Angular?”
- “What are some examples of decorators in Angular?”
- “What are some other examples of decorators in Angular?”
How would you replace any with appropriate types and prevent its reintroduction across a TypeScript project?
Asked in 2 of 45 interviews · last asked Oct 14 · Scenario · Senior
Show answer
I would review each `any` and replace it with a specific type, a union, or a generic that preserves type relationships. For untrusted data, I would use `unknown` and validate it before use. I would enable strict TypeScript checks and ESLint rules, then run both in CI to catch new problems.
- Enable `strict`; its `noImplicitAny` check catches implicit `any` errors but does not ban explicit `any`.
- Use `@typescript-eslint/no-explicit-any` to ban explicit `any`, and type-aware `no-unsafe-*` rules to catch unsafe uses.
- Narrow `unknown` with type guards or runtime validation; do not hide problems with type assertions.
- Fix types at their source, including dependency declarations; document and limit unavoidable exceptions.
What the interviewer checks: The interviewer is checking whether you can improve type safety and enforce it across the project.
Other ways it was asked
- “If you wanted to eliminate `any` throughout a project, how would you approach it and add rules so your team avoids using `any` in the codebase?”
- “How would you replace any types with appropriate TypeScript types?”
Do you have a favorite feature in TypeScript that you miss when you switch to another language?
Asked once · last asked Apr 23 · Concept · Mid-level
Show answer
My favorite feature is discriminated unions. TypeScript uses a shared field, such as `kind`, to narrow a union and check which properties I can access. I miss this when another language needs more manual checks, though some languages have similar features.
- Each union member has a different literal value for the shared field.
- Checking that field narrows the type without a type assertion.
- A `never` check can catch missing cases when new union members are added.
What the interviewer checks: The interviewer wants to see whether you can explain a feature you value and its practical benefits.
If you have an array of items and want to add one more item, how would you do it in JavaScript or TypeScript?
Asked once · last asked Aug 25 · Write code · Junior
Show answer
Use `items.push(newItem)` to add an item to the end of the existing array. To create a new array without changing the original, use `[...items, newItem]`. In TypeScript, `push` requires an item allowed by the array’s element type.
- `push` changes the original array and returns its new length.
- Spread creates a new array and leaves the original unchanged.
- TypeScript checks that the pushed item has an allowed type.
JavaScriptconst items = [1, 2]; items.push(3); // items is now [1, 2, 3] const newItems = [...items, 4]; // [1, 2, 3, 4] // items is still [1, 2, 3]What the interviewer checks: The interviewer is checking whether you can add an item and distinguish changing an array from creating a new one.
What are the two TypeScript types that are not represented in JavaScript?
Asked once · last asked Aug 25 · Concept · Mid-level
Show answer
The usual answer is tuples and enums. A tuple describes an array with known types at specific positions. An enum defines named constants. Tuple types are removed during compilation, while regular enums generate JavaScript code.
- JavaScript has arrays, but no built-in tuple type syntax.
- Regular enums create runtime values; const enums are usually inlined.
- TypeScript has other type features too, so “two” is not a strict total.
What the interviewer checks: The interviewer is checking whether you understand tuples, enums, and how they become JavaScript.
What happens when you try to access a property on null in TypeScript?
Asked once · last asked Sep 1 · Concept · Junior
Show answer
Accessing a property on null throws a TypeError at runtime. With strictNullChecks enabled, TypeScript reports a compile-time error if the value may be null. Check for null first, or use optional chaining, which returns undefined when the value is null.
- TypeScript types do not add runtime null checks.
- strictNullChecks helps catch unsafe property access before running the code.
- Optional chaining safely handles both null and undefined.
- A non-null assertion (!) removes a type warning but does not prevent a runtime error.
What the interviewer checks: The interviewer is checking whether you distinguish compile-time null checks from runtime behavior.
What data types are available in JavaScript and TypeScript?
Asked once · last asked Oct 8 · Concept · Junior
Show answer
JavaScript has seven primitive types: string, number, bigint, boolean, symbol, undefined, and null. It also has objects, including arrays and functions. TypeScript supports these and adds static types such as any, unknown, never, void, tuples, unions, and intersections. TypeScript type annotations are removed during compilation.
- Despite typeof null returning "object", null is a primitive value.
- Interfaces and type aliases let you describe custom types.
- any disables type checking; unknown requires narrowing or a type assertion before most operations.
- void usually describes an ignored function return value; never means a value cannot occur.
What the interviewer checks: The interviewer checks whether you distinguish JavaScript runtime values from TypeScript’s static type system.
What does the TypeScript notation `string[]` mean?
Asked once · last asked Oct 8 · Concept · Junior
Show answer
`string[]` means an array of strings in TypeScript. Each element must be a string when checked by TypeScript. It is the same type as `Array<string>`.
- The array can be empty or contain multiple strings.
- TypeScript rejects adding values of other types during type checking.
- The type does not check values at runtime.
What the interviewer checks: The interviewer is checking whether you understand array types and their element type restrictions.
Can you give an example of how to use type assertions in TypeScript?
Asked once · last asked Jul 20 · Concept · Junior
Show answer
Use `as` to tell TypeScript to treat a value as a specific type. For example, if a DOM element is known to be an input, assert `HTMLInputElement` to access its `value` property. Assertions do not check or convert values at runtime.
- Use assertions when you know more about a value’s type than TypeScript does.
- A wrong assertion can cause runtime errors.
- Handle null separately when an element might not exist.
Code// The page contains <input id="email">. const input = document.getElementById("email") as HTMLInputElement | null; if (input !== null) { input.value = "user@example.com"; }What the interviewer checks: The interviewer checks whether you can use assertion syntax and explain its runtime limits.
How does structural typing work in TypeScript, and how does it differ from nominal typing?
Asked once · last asked Oct 7 · Concept · Senior
Show answer
TypeScript uses structural typing: types are compatible when their members match, even if their names differ. A value can fit a target type if it has all required members with compatible types. Nominal typing instead uses declared type identity and explicit relationships, such as inheritance.
- Extra members usually do not prevent assignment.
- Fresh object literals get extra checks for unknown properties.
- Private and protected class members must come from the same declaration for compatibility.
Codeinterface Person { name: string; } const employee = { name: "Ana", role: "Developer" }; const person: Person = employee; // Allowed: required members match.What the interviewer checks: The interviewer is checking whether you understand that matching structure usually matters more than type names in TypeScript.
What does it mean for a function to return void or to be private or public?
Asked once · last asked Jun 4 · Concept · Junior
Show answer
In TypeScript, `void` means a function provides no usable return value to its caller. A `private` method is accessible only within the class that declares it. A `public` method is accessible from anywhere. Return types and access modifiers describe separate things.
- Class methods are public by default.
- Private methods cannot be accessed directly by subclasses.
- A function returning a value can satisfy a void-returning callback type; its return value is ignored.
- TypeScript’s private modifier is checked at compile time; JavaScript’s #private members enforce privacy at runtime.
What the interviewer checks: The interviewer is checking whether you distinguish return types from access control and understand TypeScript’s privacy rules.
What does `extends` mean in TypeScript and JavaScript?
Asked once · last asked Oct 8 · Concept · Junior
Show answer
In JavaScript, `extends` makes one class inherit from another. TypeScript supports this too, and also uses `extends` for interface inheritance, generic constraints, and conditional types. Class inheritance affects runtime behavior; TypeScript’s type-only uses do not.
- A class can extend one parent class, inheriting instance methods and static members.
- A TypeScript interface can extend multiple interfaces.
- A generic constraint such as `T extends User` requires T to be assignable to User.
- A conditional type such as `T extends string ? A : B` selects a type based on assignability.
What the interviewer checks: The interviewer checks whether you distinguish runtime class inheritance from TypeScript’s type-only uses of `extends`.
TypeScript basics interview questions
Start with what TypeScript adds to JavaScript, then cover basic types, variable declarations, arrays, functions, and null behavior. 8 questions.
TypeScript types and interfaces interview questions
Questions compare type aliases and interfaces, and cover structural typing, inheritance, access modifiers, and type assertions. 5 questions.
TypeScript union types and narrowing interview questions
Check how unions, type guards, and exhaustive checks work with any, unknown, never, and nullable values. 10 questions.
In a TypeScript code base, how do you enforce exhaustive handling of a discriminated union in a switch?
Asked once · last asked Jul 16 · Concept · Mid-level
How do you forbid props in discriminated unions, and when would you use never versus omitting keys?
Asked once · last asked Jul 28 · Concept · Mid-level
Other ways it was asked
- “How do you represent forbidden props in TypeScript discriminated unions?”
- “When modeling mutually exclusive props in TypeScript, how do you choose between using never, omitting keys, or another approach, and what are the downsides?”
What are discriminated unions in TypeScript used for?
Asked once · last asked Oct 7 · Concept · Mid-level
How should a TypeScript feature flag implementation handle a null value?
Asked once · last asked Sep 1 · Write code · Junior
What is `unknown` in TypeScript, and why do we use it?
Asked once · last asked Sep 21 · Concept · Junior
Other ways it was asked
- “What is `unknown`, and why do we use it?”
What is TypeScript, and how does type narrowing work in it?
Asked once · last asked Oct 6 · Concept · Junior
How does TypeScript's `any` type differ from more specific types?
Asked once · last asked Oct 7 · Concept · Junior
TypeScript generics and advanced types interview questions
Explore generic functions, utility types, conditional types, variance, and reusable models such as typed design tokens. 7 questions.
How do you use advanced TypeScript features such as generics and conditional types? Can you give examples?
Asked once · last asked Jun 26 · Concept · Senior
How can you use TypeScript generics to type server responses?
Asked once · last asked Jun 26 · Concept · Mid-level
What are Pick, Partial, and Omit used for in TypeScript?
Asked once · last asked Aug 5 · Concept · Mid-level
How would you type design tokens and their behaviors?
Asked once · last asked Oct 1 · Concept · Senior
Explain covariance, contravariance, and bivariance, and why they matter for function types.
Asked once · last asked Oct 7 · Concept · Senior
What are interfaces and generics in TypeScript, and when would you use them?
Asked once · last asked Oct 16 · Concept · Mid-level
React TypeScript interview questions
React questions cover typed props, polymorphic components, refs, reducers, state, data fetching, and performance. 13 questions.
How do you reliably narrow a discriminated union of React component props inside the component?
Asked once · last asked Jul 22 · Concept · Senior
Other ways it was asked
- “How do you reliably narrow a discriminated union of React component props, and what pitfalls can arise in JSX or inline callbacks?”
How do you use TypeScript to improve code quality in React projects?
Asked once · last asked Oct 15 · Tooling · Mid-level
How do you manage component state as a TypeScript and React UI grows in complexity? What techniques do you use, such as lifting state, hooks, or a state-management library?
Asked once · last asked May 16 · Tooling · Mid-level
When would you choose discriminated unions over function overloads in TypeScript for modeling UI component props, and why?
Asked once · last asked Jul 16 · Concept · Mid-level
In a React plus TypeScript app, how do you type a reducer so dispatch only accepts valid actions and the reducer stays exhaustively checked as actions evolve?
Asked once · last asked Jul 19 · Concept · Senior
How would you model a React component's props with a discriminated union so that when variant is linked it requires ref, and when variant is button it requires onClick?
Asked once · last asked Jul 22 · Concept · Senior
In a React component props API, when do you prefer interface extends versus type intersections, and what edge case drives that choice?
Asked once · last asked Jul 28 · Concept · Senior
How would you type mutually exclusive React button props for link mode versus button mode?
Asked once · last asked Jul 28 · Write code · Mid-level
Other ways it was asked
- “Could you briefly describe an example of a component with mutually exclusive props, and how you'd type it in TypeScript?”
- “How would you type a button's props in TypeScript so that link mode requires an href and forbids onClick, while button mode allows onClick and forbids href?”
How would you build a highly interactive, data-dense React screen with TypeScript, keep it fast, and measure its performance?
Asked once · last asked Oct 5 · Behavioral · Senior
Other ways it was asked
- “Can you tell me about a time you built a highly interactive, data-dense React screen with TypeScript, how you kept it fast, and the performance numbers you achieved?”
How would you type a TodoForm so that create mode rejects fields meant only for edit mode, such as an id?
Asked once · last asked Oct 12 · Concept · Mid-level
Can you add TypeScript types for the users and filtered users, and optimize the code for React 18 without the React compiler?
Asked once · last asked Oct 14 · Write code · Mid-level
In a React and TypeScript app consuming a payments API, how would you structure data fetching and cache invalidation for the payments list and create-payment flow so the UI stays consistent after mutations?
Asked once · last asked Oct 22 · Design · Mid-level
TypeScript API types and runtime validation interview questions
Work through DTOs, schema-inferred fetch helpers, external data validation, nullable responses, and type contracts with backend services. 6 questions.
When you encounter mismatches between front-end TypeScript types and back-end API responses, how do you go about aligning them?
Asked once · last asked Jul 11 · Scenario · Mid-level
When consuming backend responses with optional or nullable fields, how do you define TypeScript types and validate data at runtime to avoid unsafe casts in UI code?
Asked once · last asked Jul 19 · Scenario · Mid-level
How do you ensure that the TypeScript monorepo seamlessly integrates with Rust microservices?
Asked once · last asked Jul 20 · Design · Senior
How would you validate external data in TypeScript, given that its types do not exist at runtime?
Asked once · last asked Jul 23 · Concept · Mid-level
Other ways it was asked
- “If types don't exist at runtime, what about data coming from outside?”
How would you type a schema-based fetch helper that returns a Promise of the schema-inferred type?
Asked once · last asked Jul 28 · Write code · Senior
Other ways it was asked
- “In TypeScript, how do you type an async data fetching function so its return type is inferred from a Zod or similar schema and consumers get fully typed results?”
- “How would you type a reusable FetchJSON helper that accepts a schema and returns a Promise of the schema-inferred type for each call?”
What is a data transfer object (DTO), and how is it used in TypeScript?
Asked once · last asked Oct 7 · Concept · Junior
TypeScript async programming and backend interview questions
Backend questions cover promises, concurrency limits, typed batch results, database errors, request handling, and MCP server implementation. 7 questions.
In TypeScript, how would you model and handle errors from asynchronous database calls so you can distinguish a unique-constraint violation from other failures without using `any`?
Asked once · last asked Sep 3 · Concept · Mid-level
In JavaScript and TypeScript, what's the difference between `Promise.all` and `Promise.allSettled`? When would you choose `Promise.allSettled` in a backend workflow?
Asked once · last asked Sep 3 · Concept · Mid-level
In a Node.js and TypeScript service, how would you implement concurrency limiting—for example, allowing at most five parallel asynchronous tasks to process an array of 1,000 items—while keeping the code maintainable?
Asked once · last asked Sep 3 · Write code · Senior
In TypeScript, how would you type a generic `mapLimit` function that takes items, a concurrency limit, and a mapper returning a promise, while preserving result order and surfacing per-item errors cleanly?
Asked once · last asked Sep 3 · Write code · Senior
If the mapper can fail for individual items, how would you type the return value so callers can distinguish success from failure for each index without throwing for the whole batch?
Asked once · last asked Sep 3 · Write code · Mid-level
How should you define controllers and routes in TypeScript to handle requests and responses?
Asked once · last asked Sep 13 · Concept · Mid-level
How would you build an MCP server using TypeScript, including initialization, capabilities, tools, and prompts?
Asked once · last asked Sep 21 · Write code · Senior
TypeScript decorators, Angular and NestJS interview questions
Review Angular and NestJS decorators, framework choices, components, modules, and RxJS operators. 4 questions.
How do you use decorators in NestJS?
Asked once · last asked May 27 · Concept · Junior
Why might you choose NestJS over other options when building a new system with TypeScript?
Asked once · last asked Sep 4 · Concept · Mid-level
What are TypeScript and RxJS, and can you explain components, modules, promises, and switchMap?
Asked once · last asked Aug 10 · Concept · Junior
TypeScript debugging and code quality interview questions
Code quality questions ask about debugging, testing, type checking, linting, removing any, maintenance, and lessons from production bugs. 7 questions.
How would you approach debugging a “data.map is not a function” error in a user list written in TSX?
Asked once · last asked Oct 14 · Scenario · Mid-level
Could you describe a particularly challenging bug you encountered in a TypeScript project and walk me through how you debugged and resolved it?
Asked once · last asked Apr 16 · Behavioral · Mid-level
After identifying a TypeScript type-contract failure in a component, what technical steps would you take to fix it and prevent it from happening again?
Asked once · last asked Apr 16 · Behavioral · Mid-level
Other ways it was asked
- “After identifying a TypeScript type-contract failure, what technical steps did you take to fix it and prevent it from happening again?”
What is your approach to writing and maintaining TypeScript?
Asked once · last asked Jul 15 · Concept · Mid-level
How do you verify that code works, TypeScript types are correct, and code style remains consistent?
Asked once · last asked Oct 14 · Scenario · Mid-level
Tell me about a time TypeScript's type system prevented a bug in production.
Asked once · last asked Oct 16 · Behavioral · Mid-level
Live coding round next? Coding mode in the MeetAssist desktop app solves the problem on your screen, with your phone as the remote.
Related interview questions
- Software Engineer interview questions
- QA Engineer interview questions
- AI Engineer interview questions
- Cybersecurity interview questions
- Python interview questions
- Java interview questions
- JavaScript interview questions
- C# and .NET interview questions
- C++ interview questions
- PHP and Laravel interview questions
How this list is made
Every question here was asked by a real interviewer in a real job interview that a candidate ran MeetAssist in. After the call, the interviewer's questions are pulled from the transcript. Practice sessions, tests, exams and anything that was not a job interview are dropped.
Questions are rewritten so they make sense on their own: names of people, employers and clients are removed, and speech-to-text mistakes are fixed. Small talk, logistics and questions about one candidate's own résumé are left out. Rephrasings of the same question are merged, and the count is the number of different interviews it came up in.
The interviews come from candidates who use MeetAssist, so they lean towards software, data and AI roles: the shares describe these interviews, not every TypeScript interview. Answers to the most asked questions are written and checked by an editor; a "common mistake" is shown only when reviews of real answers in these interviews show it, with the count.
45 interviews, 37 candidates, Oct 2025 to Oct 2026. Updated every month with new interviews.
Or add the Chrome extension