Generics interview questions

15 real Generics questions from the Go 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 Type parameter?

Mid
  1. A.the compiler's ability to deduce omitted type arguments from the ordinary arguments passed to a generic call
  2. B.the predeclared constraint matching any type whose values may be compared with the equality operators
  3. C.an interface used in square brackets that restricts which types a generic parameter may be instantiated with
  4. D.a placeholder in square brackets that lets a function or type operate over many concrete types (added in 1.18)
Reveal the answer + AI explanation — free account

3. Which statement is correct?

Mid
  1. A.Type parameter — the compiler's ability to deduce omitted type arguments from the ordinary arguments passed to a generic call
  2. B.Type parameter — an interface used in square brackets that restricts which types a generic parameter may be instantiated with
  3. C.Type parameter — the predeclared constraint matching any type whose values may be compared with the equality operators
  4. D.Type parameter — a placeholder in square brackets that lets a function or type operate over many concrete types (added in 1.18)
Reveal the answer + AI explanation — free account

4. What is Constraint?

Mid
  1. A.an interface used in square brackets that restricts which types a generic parameter may be instantiated with
  2. B.the collection of concrete types permitted by a constraint, expressible with union elements separated by a bar
  3. C.the compiler's ability to deduce omitted type arguments from the ordinary arguments passed to a generic call
  4. D.a placeholder in square brackets that lets a function or type operate over many concrete types (added in 1.18)
Reveal the answer + AI explanation — free account

6. Which statement is correct?

Mid
  1. A.Constraint — an interface used in square brackets that restricts which types a generic parameter may be instantiated with
  2. B.Constraint — a placeholder in square brackets that lets a function or type operate over many concrete types (added in 1.18)
  3. C.Constraint — the predeclared constraint matching any type whose values may be compared with the equality operators
  4. D.Constraint — the collection of concrete types permitted by a constraint, expressible with union elements separated by a bar
Reveal the answer + AI explanation — free account

7. What is comparable?

Mid
  1. A.an interface used in square brackets that restricts which types a generic parameter may be instantiated with
  2. B.a placeholder in square brackets that lets a function or type operate over many concrete types (added in 1.18)
  3. C.the predeclared constraint matching any type whose values may be compared with the equality operators
  4. D.the collection of concrete types permitted by a constraint, expressible with union elements separated by a bar
Reveal the answer + AI explanation — free account

9. Which statement is correct?

Mid
  1. A.comparable — the predeclared constraint matching any type whose values may be compared with the equality operators
  2. B.comparable — the collection of concrete types permitted by a constraint, expressible with union elements separated by a bar
  3. C.comparable — the compiler's ability to deduce omitted type arguments from the ordinary arguments passed to a generic call
  4. D.comparable — a placeholder in square brackets that lets a function or type operate over many concrete types (added in 1.18)
Reveal the answer + AI explanation — free account

10. What is Type set?

Senior
  1. A.a placeholder in square brackets that lets a function or type operate over many concrete types (added in 1.18)
  2. B.the predeclared constraint matching any type whose values may be compared with the equality operators
  3. C.the compiler's ability to deduce omitted type arguments from the ordinary arguments passed to a generic call
  4. D.the collection of concrete types permitted by a constraint, expressible with union elements separated by a bar
Reveal the answer + AI explanation — free account

12. Which statement is correct?

Senior
  1. A.Type set — the predeclared constraint matching any type whose values may be compared with the equality operators
  2. B.Type set — the compiler's ability to deduce omitted type arguments from the ordinary arguments passed to a generic call
  3. C.Type set — an interface used in square brackets that restricts which types a generic parameter may be instantiated with
  4. D.Type set — the collection of concrete types permitted by a constraint, expressible with union elements separated by a bar
Reveal the answer + AI explanation — free account

13. What is Type inference?

Senior
  1. A.an interface used in square brackets that restricts which types a generic parameter may be instantiated with
  2. B.the compiler's ability to deduce omitted type arguments from the ordinary arguments passed to a generic call
  3. C.a placeholder in square brackets that lets a function or type operate over many concrete types (added in 1.18)
  4. D.the predeclared constraint matching any type whose values may be compared with the equality operators
Reveal the answer + AI explanation — free account

15. Which statement is correct?

Senior
  1. A.Type inference — the predeclared constraint matching any type whose values may be compared with the equality operators
  2. B.Type inference — an interface used in square brackets that restricts which types a generic parameter may be instantiated with
  3. C.Type inference — the collection of concrete types permitted by a constraint, expressible with union elements separated by a bar
  4. D.Type inference — the compiler's ability to deduce omitted type arguments from the ordinary arguments passed to a generic call
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