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
“Undefined Behavior” in Information Technology
14 questions across 1 technology.
Information Technology
14 questions in 1 technology
#
Question
Technology
Topic
Level
1
What is
undefined
behavior
(UB) in C++?
C++ › Undefined Behavior
C++
Undefined
Behavior
Beginner
2
Why is reading an uninitialized variable
undefined
behavior
?
C++ › Undefined Behavior
C++
Undefined
Behavior
Beginner
3
What are common causes of
undefined
behavior
?
C++ › Undefined Behavior
C++
Undefined
Behavior
Intermediate
4
How do you detect and prevent
undefined
behavior
?
C++ › Undefined Behavior
C++
Undefined
Behavior
Intermediate
5
How can
undefined
behavior
cause 'impossible' optimizations and bugs?
C++ › Undefined Behavior
C++
Undefined
Behavior
Advanced
6
What is a data race and why is it
undefined
behavior
?
C++ › Undefined Behavior
C++
Undefined
Behavior
Advanced
7
What is the difference between
undefined
, unspecified, and implementation-defined
behavior
?
C++ › Undefined Behavior
C++
Undefined
Behavior
Beginner
8
Why is signed integer overflow
undefined
but unsigned overflow defined?
C++ › Undefined Behavior
C++
Undefined
Behavior
Intermediate
9
What happens if you dereference a null pointer?
C++ › Undefined Behavior
C++
Undefined
Behavior
Beginner
10
What is the strict aliasing rule and how can violating it cause UB?
C++ › Undefined Behavior
C++
Undefined
Behavior
Advanced
11
What is reinterpret_cast and why is it dangerous?
C++ › Casting & Conversions
C++
Casting & Conversions
Intermediate
12
Why are C-style casts discouraged in C++?
C++ › Casting & Conversions
C++
Casting & Conversions
Advanced
13
What is the difference between static_cast and dynamic_cast for downcasting?
C++ › Casting & Conversions
C++
Casting & Conversions
Advanced
14
What is std::bit_cast (C++20)?
C++ › Casting & Conversions
C++
Casting & Conversions
Advanced