15 Templates and Generics questions from the C++ 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.
A.a parameterized blueprint from which the compiler generates concrete functions by deducing or supplying type arguments
B.an alternative definition supplied for a specific set of template arguments, overriding the primary template for those types
C.the rule that an invalid substitution of template arguments removes a candidate from overload resolution rather than causing a hard error
D.a template accepting an arbitrary number of arguments via a parameter pack that can be expanded recursively or with fold expressions
Answer + AI explanation with Pro
2. Which term means: "a parameterized blueprint from which the compiler generates concrete functions by deducing or supplying type arguments"?
Junior
A.Template specialization
B.Concept (C++20)
C.Function template
D.Variadic template
Answer + AI explanation with Pro
3. Which statement is correct?
Junior
A.Function template — a parameterized blueprint from which the compiler generates concrete functions by deducing or supplying type arguments
B.Function template — the rule that an invalid substitution of template arguments removes a candidate from overload resolution rather than causing a hard error
C.Function template — a named compile-time predicate on template arguments that constrains which types may instantiate a template and improves error messages
D.Function template — an alternative definition supplied for a specific set of template arguments, overriding the primary template for those types
Answer + AI explanation with Pro
4. What is Template specialization?
Mid
A.the rule that an invalid substitution of template arguments removes a candidate from overload resolution rather than causing a hard error
B.a template accepting an arbitrary number of arguments via a parameter pack that can be expanded recursively or with fold expressions
C.a named compile-time predicate on template arguments that constrains which types may instantiate a template and improves error messages
D.an alternative definition supplied for a specific set of template arguments, overriding the primary template for those types
Answer + AI explanation with Pro
5. Which term means: "an alternative definition supplied for a specific set of template arguments, overriding the primary template for those types"?
Mid
A.Concept (C++20)
B.SFINAE
C.Variadic template
D.Template specialization
Answer + AI explanation with Pro
6. Which statement is correct?
Mid
A.Template specialization — a named compile-time predicate on template arguments that constrains which types may instantiate a template and improves error messages
B.Template specialization — a parameterized blueprint from which the compiler generates concrete functions by deducing or supplying type arguments
C.Template specialization — an alternative definition supplied for a specific set of template arguments, overriding the primary template for those types
D.Template specialization — a template accepting an arbitrary number of arguments via a parameter pack that can be expanded recursively or with fold expressions
Answer + AI explanation with Pro
7. What is SFINAE?
Senior
A.a template accepting an arbitrary number of arguments via a parameter pack that can be expanded recursively or with fold expressions
B.the rule that an invalid substitution of template arguments removes a candidate from overload resolution rather than causing a hard error
C.an alternative definition supplied for a specific set of template arguments, overriding the primary template for those types
D.a named compile-time predicate on template arguments that constrains which types may instantiate a template and improves error messages
Answer + AI explanation with Pro
8. Which term means: "the rule that an invalid substitution of template arguments removes a candidate from overload resolution rather than causing a hard error"?
Senior
A.Template specialization
B.SFINAE
C.Function template
D.Concept (C++20)
Answer + AI explanation with Pro
9. Which statement is correct?
Senior
A.SFINAE — a template accepting an arbitrary number of arguments via a parameter pack that can be expanded recursively or with fold expressions
B.SFINAE — the rule that an invalid substitution of template arguments removes a candidate from overload resolution rather than causing a hard error
C.SFINAE — an alternative definition supplied for a specific set of template arguments, overriding the primary template for those types
D.SFINAE — a parameterized blueprint from which the compiler generates concrete functions by deducing or supplying type arguments
Answer + AI explanation with Pro
10. What is Concept (C++20)?
Mid
A.an alternative definition supplied for a specific set of template arguments, overriding the primary template for those types
B.the rule that an invalid substitution of template arguments removes a candidate from overload resolution rather than causing a hard error
C.a parameterized blueprint from which the compiler generates concrete functions by deducing or supplying type arguments
D.a named compile-time predicate on template arguments that constrains which types may instantiate a template and improves error messages
Answer + AI explanation with Pro
11. Which term means: "a named compile-time predicate on template arguments that constrains which types may instantiate a template and improves error messages"?
Mid
A.SFINAE
B.Variadic template
C.Function template
D.Concept (C++20)
Answer + AI explanation with Pro
12. Which statement is correct?
Mid
A.Concept (C++20) — a parameterized blueprint from which the compiler generates concrete functions by deducing or supplying type arguments
B.Concept (C++20) — a named compile-time predicate on template arguments that constrains which types may instantiate a template and improves error messages
C.Concept (C++20) — a template accepting an arbitrary number of arguments via a parameter pack that can be expanded recursively or with fold expressions
D.Concept (C++20) — an alternative definition supplied for a specific set of template arguments, overriding the primary template for those types
Answer + AI explanation with Pro
13. What is Variadic template?
Senior
A.an alternative definition supplied for a specific set of template arguments, overriding the primary template for those types
B.a template accepting an arbitrary number of arguments via a parameter pack that can be expanded recursively or with fold expressions
C.the rule that an invalid substitution of template arguments removes a candidate from overload resolution rather than causing a hard error
D.a named compile-time predicate on template arguments that constrains which types may instantiate a template and improves error messages
Answer + AI explanation with Pro
14. Which term means: "a template accepting an arbitrary number of arguments via a parameter pack that can be expanded recursively or with fold expressions"?
Senior
A.Function template
B.Variadic template
C.Template specialization
D.Concept (C++20)
Answer + AI explanation with Pro
15. Which statement is correct?
Senior
A.Variadic template — a parameterized blueprint from which the compiler generates concrete functions by deducing or supplying type arguments
B.Variadic template — a template accepting an arbitrary number of arguments via a parameter pack that can be expanded recursively or with fold expressions
C.Variadic template — a named compile-time predicate on template arguments that constrains which types may instantiate a template and improves error messages
D.Variadic template — an alternative definition supplied for a specific set of template arguments, overriding the primary template for those types
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 Templates and Generics question come with Pro.