C++ For Interviews
Michael Sukkarieh
Introduction
Disclaimer
Goals of the talk
History
Industries using C++
Hello World
1 - #include preprocessor command (similar to C)
3 - using namespace declaration (discussed later)
5 - main method entry point (similar to C)
6 - cout is a stream which outputs to stdout (similar to C or printf). Can also just use printf
Basic Similarities (C like)
C++ vs C
C++ is Object Oriented
new/delete instead of malloc/free
Generic Programming with Templates
Namespaces
C++ standard library
C++ vs Java
Manual Memory Management
Instance Allocation on the Stack
Smart Pointers Prereq: RAII
Smart Pointers
Smart Pointer Example
Operator Overloading
C++ Interview Topics
Main Topics
Memory Allocation and Management
Program Memory Layout
Program Memory Layout
Program Memory Layout
Program Memory Layout
Working on the bit level
Working on the bit level
Working on the bit level
Virtual Methods and Dynamic Dispatch in C++
Example
Virtual Method Example and Explanation
source: https://www.learncpp.com/cpp-tutorial/125-the-virtual-table/
Possible Questions
Possible Questions
Possible Questions
Possible Questions
Misc C++ Concepts
References
Passing by reference
Reference vs Pointer
Const and Const Correctness
Const Class Methods Example
Extra topics that I wish I could cover
Resources
Questions?
Thank you!