W3
Teacher
Explore
Browse by field
Artificial Intelligence
Accounting & Finance
Information Technology
Show all fields
Interview Q&A
All Interview Questions
Beginner
Intermediate
Advanced
Practice
MCQs
Quizzes
Mock Interviews
About
Light
Dark
Auto
Sign in
Get Started
Search interview questions
Search
All fields
“Constexpr & Compile-Time” in Information Technology
13 questions across 1 technology.
Information Technology
13 questions in 1 technology
#
Question
Technology
Topic
Level
1
What is template metaprogramming versus
constexpr
for
compile-time
work?
C++ › Constexpr & Compile-Time
C++
Constexpr
&
Compile-Time
Advanced
2
What does
constexpr
mean?
C++ › Constexpr & Compile-Time
C++
Constexpr
&
Compile-Time
Beginner
3
What is the difference between const and
constexpr
?
C++ › Constexpr & Compile-Time
C++
Constexpr
&
Compile-Time
Beginner
4
What are the rules/limitations of
constexpr
functions?
C++ › Constexpr & Compile-Time
C++
Constexpr
&
Compile-Time
Intermediate
5
How does
constexpr
improve performance?
C++ › Constexpr & Compile-Time
C++
Constexpr
&
Compile-Time
Intermediate
6
What is
compile-time
computation good for, and what are its trade-offs?
C++ › Constexpr & Compile-Time
C++
Constexpr
&
Compile-Time
Advanced
7
Can
constexpr
be used with classes and containers?
C++ › Constexpr & Compile-Time
C++
Constexpr
&
Compile-Time
Advanced
8
What is 'if
constexpr
' and why is it useful?
C++ › Constexpr & Compile-Time
C++
Constexpr
&
Compile-Time
Advanced
9
What is static_assert?
C++ › Constexpr & Compile-Time
C++
Constexpr
&
Compile-Time
Beginner
10
What is consteval (C++20)?
C++ › Constexpr & Compile-Time
C++
Constexpr
&
Compile-Time
Intermediate
11
What is constinit (C++20)?
C++ › Constexpr & Compile-Time
C++
Constexpr
&
Compile-Time
Intermediate
12
What is the difference between a macro constant and a
constexpr
/const constant?
C++ › Preprocessor & Macros
C++
Preprocessor & Macros
Intermediate
13
Why are function-like macros discouraged in modern C++?
C++ › Preprocessor & Macros
C++
Preprocessor & Macros
Intermediate