Generics interview questions

18 real Generics questions from the TypeScript bank, as asked in Indian campus drives and tech interviews. Every question has a verified answer and an AI-tutor explanation on placd — free to start.

1. What is Generic?

Mid
  1. A.T extends U ? X : Y, selecting one type or another based on an assignability check
  2. B.a type parameter like <T> that lets a function or type work over many types while preserving their relationship
  3. C.in type position, produces the static type of a value or variable
  4. D.<T extends U>, restricting a type parameter to types assignable to U
Reveal the answer + AI explanation — free account

3. Which statement is correct?

Mid
  1. A.Generic — <T extends U>, restricting a type parameter to types assignable to U
  2. B.Generic — a type parameter like <T> that lets a function or type work over many types while preserving their relationship
  3. C.Generic — T extends U ? X : Y, selecting one type or another based on an assignability check
  4. D.Generic — { [K in keyof T]: ... }, a type that transforms each property of an existing type
Reveal the answer + AI explanation — free account

4. What is Generic constraint?

Mid
  1. A.a type parameter like <T> that lets a function or type work over many types while preserving their relationship
  2. B.<T extends U>, restricting a type parameter to types assignable to U
  3. C.an operator producing a union of the property names of a type
  4. D.T extends U ? X : Y, selecting one type or another based on an assignability check
Reveal the answer + AI explanation — free account

6. Which statement is correct?

Mid
  1. A.Generic constraint — an operator producing a union of the property names of a type
  2. B.Generic constraint — T extends U ? X : Y, selecting one type or another based on an assignability check
  3. C.Generic constraint — in type position, produces the static type of a value or variable
  4. D.Generic constraint — <T extends U>, restricting a type parameter to types assignable to U
Reveal the answer + AI explanation — free account

7. What is keyof?

Mid
  1. A.{ [K in keyof T]: ... }, a type that transforms each property of an existing type
  2. B.an operator producing a union of the property names of a type
  3. C.in type position, produces the static type of a value or variable
  4. D.a type parameter like <T> that lets a function or type work over many types while preserving their relationship
Reveal the answer + AI explanation — free account

9. Which statement is correct?

Mid
  1. A.keyof — an operator producing a union of the property names of a type
  2. B.keyof — in type position, produces the static type of a value or variable
  3. C.keyof — { [K in keyof T]: ... }, a type that transforms each property of an existing type
  4. D.keyof — T extends U ? X : Y, selecting one type or another based on an assignability check
Reveal the answer + AI explanation — free account

10. What is typeof type operator?

Senior
  1. A.an operator producing a union of the property names of a type
  2. B.a type parameter like <T> that lets a function or type work over many types while preserving their relationship
  3. C.T extends U ? X : Y, selecting one type or another based on an assignability check
  4. D.in type position, produces the static type of a value or variable
Reveal the answer + AI explanation — free account

12. Which statement is correct?

Senior
  1. A.typeof type operator — an operator producing a union of the property names of a type
  2. B.typeof type operator — T extends U ? X : Y, selecting one type or another based on an assignability check
  3. C.typeof type operator — { [K in keyof T]: ... }, a type that transforms each property of an existing type
  4. D.typeof type operator — in type position, produces the static type of a value or variable
Reveal the answer + AI explanation — free account

13. What is Conditional type?

Senior
  1. A.an operator producing a union of the property names of a type
  2. B.a type parameter like <T> that lets a function or type work over many types while preserving their relationship
  3. C.T extends U ? X : Y, selecting one type or another based on an assignability check
  4. D.{ [K in keyof T]: ... }, a type that transforms each property of an existing type
Reveal the answer + AI explanation — free account

15. Which statement is correct?

Senior
  1. A.Conditional type — { [K in keyof T]: ... }, a type that transforms each property of an existing type
  2. B.Conditional type — T extends U ? X : Y, selecting one type or another based on an assignability check
  3. C.Conditional type — in type position, produces the static type of a value or variable
  4. D.Conditional type — a type parameter like <T> that lets a function or type work over many types while preserving their relationship
Reveal the answer + AI explanation — free account

16. What is Mapped type?

Senior
  1. A.in type position, produces the static type of a value or variable
  2. B.T extends U ? X : Y, selecting one type or another based on an assignability check
  3. C.a type parameter like <T> that lets a function or type work over many types while preserving their relationship
  4. D.{ [K in keyof T]: ... }, a type that transforms each property of an existing type
Reveal the answer + AI explanation — free account

18. Which statement is correct?

Senior
  1. A.Mapped type — T extends U ? X : Y, selecting one type or another based on an assignability check
  2. B.Mapped type — { [K in keyof T]: ... }, a type that transforms each property of an existing type
  3. C.Mapped type — a type parameter like <T> that lets a function or type work over many types while preserving their relationship
  4. D.Mapped type — in type position, produces the static type of a value or variable
Reveal the answer + AI explanation — free account

Free to start

Answers, AI explanations, and a scored voice mock interview

Sign up free to check your answers with explanations, ask the AI tutor anything on any question, and take one full AI mock interview — scored like a real panel.

Practice Generics free