A pointer passed by value to a function allows the function to change the _______ to which the pointer points. 

  • value 
  • address 
  • direction 
  • data type
When a pointer is passed by value to a function, the function gets a copy of the pointer. This means that the function can modify the data at the address the pointer points to, but it cannot change the address of the original pointer itself.

Which operator will give the remainder of a division operation? 

  • / 
  • * 
  • + 
  • %
The '%' operator in C++ is called the modulus operator. It is used to determine the remainder of a division operation between two integers. For example, '7 % 3' will return 1 as the remainder.

When an array is passed to a function, it is always passed by _______. 

  • value 
  • reference 
  • name 
  • address
When an array is passed to a function, it is passed by name, which essentially means the address of the array is passed. This allows functions to modify the original array. The behavior is similar to passing by reference.

A class that contains at least one pure virtual function is called a(n) _______. 

  • subclass 
  • instantiated class 
  • abstract class 
  • inherited class
An abstract class in C++ is a class that contains at least one pure virtual function. This means the class cannot be instantiated and is meant to be inherited by other classes that provide implementations for the pure virtual functions.

What potential issue might arise when using switch-case statements with enumerated types? 

  • Memory leaks. 
  • Switching to an incorrect case accidentally. 
  • Skipping the default case. 
  • Not handling newly added enumerators in the switch.
When using switch-case statements with enumerated types, if a new enumerator is added to the enumeration and not correspondingly handled in the switch statement, it can lead to potential issues or bugs. This is because the switch might not have a case for the new enumerator, and if there's no default case or if the default case doesn't handle it appropriately, the program can behave unpredictably.

The first commercially available C++ compiler was named _______. 

  • CFront
  • Clang 
  • GCC 
  • Turbo C++ 
CFront was the first commercially available C++ compiler. It was developed by Bjarne Stroustrup at Bell Labs as a front-end to the C compiler. This compiler played a crucial role in the early evolution and popularization of C++.

How does C++ treat an enum regarding its type and size? 

  • As a float type with fixed size 
  • As an integer type with variable size 
  • As a class with member functions 
  • As a boolean type
Enums in C++ are treated as integer types. Their actual size can vary based on the compiler and the number of values they hold, but typically, they have the size of an int. C++11 introduced scoped enumerations (enum class) that offer better type safety, but fundamentally, they're still integers.

If a break statement is encountered in a nested loop, it will exit _______. 

  • the outermost loop 
  • the innermost loop 
  • the function 
  • the program
When a break statement is encountered within a nested loop, it only exits the loop in which it's directly contained, i.e., the innermost loop. It does not affect any outer enclosing loops.

What is a friend function in C++? 

  • A function that always returns a friend object. 
  • A private function of a class. 
  • A function that can access private members of a class. 
  • A function that can only be called within its class.
A friend function in C++ is a special function that, although not a member of a class, has access to its private and protected members. This is used to allow non-member functions and other classes to access such members.

Consider a large-scale software project that heavily utilizes templates and generic programming. With an impending deadline, the compilation time is becoming a significant bottleneck. Which C++ feature/technique might be best suited to reduce compilation times without altering runtime performance? 

  • Decrease template depth 
  • Explicit template instantiation 
  • Use dynamic polymorphism
  • Use of inline functions 
Explicit template instantiation can help reduce compilation times by instructing the compiler to instantiate the templates in a specific source file rather than whenever they're used. This can help reduce redundancy and speed up the compilation of large projects that heavily rely on templates.