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
“Preprocessor & Macros” in Information Technology
16 questions across 1 technology.
Information Technology
16 questions in 1 technology
#
Question
Technology
Topic
Level
1
What is the C++
preprocessor
?
C++ › Preprocessor & Macros
C++
Preprocessor
&
Macros
Beginner
2
What are predefined
macros
like __LINE__ and __FILE__?
C++ › Preprocessor & Macros
C++
Preprocessor
&
Macros
Beginner
3
Why are function-like
macros
discouraged in modern C++?
C++ › Preprocessor & Macros
C++
Preprocessor
&
Macros
Intermediate
4
What are the dangers of
macros
affecting names and how do you mitigate them?
C++ › Preprocessor & Macros
C++
Preprocessor
&
Macros
Advanced
5
What is the difference between #include with angle brackets and quotes?
C++ › Preprocessor & Macros
C++
Preprocessor
&
Macros
Beginner
6
What is an include guard and why is it needed?
C++ › Preprocessor & Macros
C++
Preprocessor
&
Macros
Beginner
7
What are conditional compilation directives used for?
C++ › Preprocessor & Macros
C++
Preprocessor
&
Macros
Intermediate
8
What is the difference between a macro constant and a constexpr/const constant?
C++ › Preprocessor & Macros
C++
Preprocessor
&
Macros
Intermediate
9
What are the # (stringize) and ## (token paste) operators?
C++ › Preprocessor & Macros
C++
Preprocessor
&
Macros
Advanced
10
How does #pragma once compare to traditional include guards?
C++ › Preprocessor & Macros
C++
Preprocessor
&
Macros
Advanced
11
What is the difference between an enum and a set of #define constants?
C++ › Enums & Enum Classes
C++
Enums & Enum Classes
Beginner
12
What are the stages of building a C++ program?
C++ › Compilation & Linking
C++
Compilation & Linking
Beginner
13
What is a translation unit?
C++ › Compilation & Linking
C++
Compilation & Linking
Beginner
14
What is the difference between compile-time and link-time errors?
C++ › Compilation & Linking
C++
Compilation & Linking
Beginner
15
Why do you need include guards or #pragma once, in linkage terms?
C++ › Compilation & Linking
C++
Compilation & Linking
Intermediate
16
What are C++20 modules and how do they improve on headers?
C++ › Compilation & Linking
C++
Compilation & Linking
Advanced