Generics interview questions

18 Generics questions from the TypeScript bank, written for Indian campus drives and tech interviews. Every question has a verified answer and an AI-tutor explanation on placd.

Free to start: the 2-minute IT readiness check — six questions and a result.

Take the free IT readiness check

or take a mock interview set up for this area

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

Answer + AI explanation with Pro

2. Which term means: "a type parameter like <T> that lets a function or type work over many types while preserving their relationship"?

Mid
  1. A.keyof
  2. B.typeof type operator
  3. C.Generic
  4. D.Conditional type

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

5. Which term means: "<T extends U>, restricting a type parameter to types assignable to U"?

Mid
  1. A.Mapped type
  2. B.Conditional type
  3. C.keyof
  4. D.Generic constraint

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

8. Which term means: "an operator producing a union of the property names of a type"?

Mid
  1. A.typeof type operator
  2. B.Conditional type
  3. C.keyof
  4. D.Generic constraint

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

11. Which term means: "in type position, produces the static type of a value or variable"?

Senior
  1. A.Mapped type
  2. B.Generic
  3. C.typeof type operator
  4. D.Conditional type

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

14. Which term means: "T extends U ? X : Y, selecting one type or another based on an assignability check"?

Senior
  1. A.Mapped type
  2. B.typeof type operator
  3. C.Generic constraint
  4. D.Conditional type

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

17. Which term means: "{ [K in keyof T]: ... }, a type that transforms each property of an existing type"?

Senior
  1. A.keyof
  2. B.Generic
  3. C.typeof type operator
  4. D.Mapped type

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

Free to start

Start with a free readiness check

Sign up free for the 2-minute IT readiness check and a scored result. Answers, explanations and the AI tutor on every Generics question come with Pro.

Take the free IT readiness check

or take a mock interview set up for this area

24,000+ questions & coding problemsSoftware & IT16,274 questionsGovernment jobs26 examsAptitudenew questions every timeAI practice interviewwith feedback65 topics to practiseMechanical1,149 questionsGATE ME9 papersEngineering Mathematics381 questions2-minute checkfreeDSA Problems1,422Civil1,005 questionsGATE CE9 papersCS Fundamentals1,209 questionsYour scores6 skillsSystem Design25Electrical / EEE1,047 questionsGATE EE9 papersRun your codeC++ · Java · PythonLow-Level Design144Electronics & Comm.975 questionsGATE EC9 papersAI help on every questionFull-Stack6,282Chemical1,005 questionsGATE CH9 papersAI whiteboardsystem designWork abroadEurope · remote · transfersESE ME1 paperGATE practice papers2019–2026ESE CE1 paperDate alertsbefore the last dateESE EE1 paperBehavioural courseHR round practiceESE ET1 paperResume optimizerProSSC JE ME1 paperApplication trackerSSC JE CE1 paperCompany-wise prepSSC JE EE1 paperRole roadmapsRRB JE1 subjectPriced in ₹UPI · cardsISRO SC1 paperGATE CS9 papersIBPS SO IT1 paperUGC NET CS1 paperSSC CGL26 papersIBPS PO26 papersRRB NTPC26 papersSSC CHSL26 papersIBPS Clerk26 papersSBI Clerk26 papersRRB Group D26 papersSSC CPO26 papersSSC GD26 papers