Understanding C++ class inheritance access control
This easy language-knowledge question tests whether you understand how access specifiers propagate when one class inherits from another in C++. It is a foundational concept that appears across many technical interviews, especially those targeting systems programming or low-latency development roles.
The question focuses on the default behaviour when a class inherits without an explicit access modifier. This distinction matters because it affects which inherited members remain accessible outside the class hierarchy and which become encapsulated. Getting this right is essential for writing robust, maintainable C++ code and for reasoning correctly about class interfaces.
- Public, protected, and private inheritance semantics
- Member visibility in derived classes
- How access specifiers change member accessibility across inheritance boundaries