James sees that two functions with identical names and parameters exist in a program. However, they perform different operations. He initially thinks it's function overloading. What misconception does he have about function overloading?

  • Function overloading allows multiple functions with the same name and different parameters
  • Function overloading allows multiple functions with the same name and same parameters
  • Function overloading is not related to function names
  • Function overloading requires different return types
James has a misconception about function overloading. Function overloading allows multiple functions with the same name but different parameters. It's the difference in parameter types or the number of parameters that distinguishes overloaded functions, not the name alone.

In C++, passing large structures or classes to functions is typically done by _______ to avoid expensive copy operations. 

  • pointers 
  • value 
  • integers 
  • operators
Passing large structures or classes by value results in copy operations, which can be expensive in terms of performance. To mitigate this, C++ developers often pass large data structures using pointers or references, allowing the function to access the original data without copying.

The function _______ is used to merge two sorted ranges in the C++ STL. 

  • combine 
  • concatenate 
  • merge 
  • join
The merge algorithm in C++ STL is used to merge two sorted ranges into a single, sorted range. Both input ranges should be sorted for the merge algorithm to work correctly.

The result of 5.5 + 2.5 in C++ is _______. 

  • 8 
  • 7.5 
  • 8 
  • 7
In C++, the addition of two floating-point numbers (like 5.5 and 2.5) will result in another floating-point number, which is 8.0 in this case.

Which of the following is not a type of iterator in C++ STL? 

  • Random access 
  • Bidirectional 
  • Dynamic 
  • Forward
The C++ STL provides several types of iterators like random access, bidirectional, and forward iterators. However, there is no iterator type named "Dynamic." Iterators are powerful tools in STL, allowing operations like traversal, reading, and writing to elements of container objects.

The function signature in C++ includes the function name and the _______. 

  • return type 
  • class name 
  • library 
  • parameters
A function signature in C++ is determined by its name and its parameter list. The return type is not considered a part of the function's signature.

The _______ keyword is used to include standard libraries in a C++ program. 

  • import 
  • include 
  • namespace
  • return 
In C++, the "include" keyword is used to include header files, which contain the declarations for the standard libraries. It's vital for utilizing predefined functions and classes, thus facilitating easier and more efficient coding.

Which keyword is often advised against using due to its potential to make code less readable and maintainable? 

  • class 
  • public 
  • goto 
  • private
The goto keyword allows for arbitrary jumps in code, which can make the code's flow hard to follow, leading to decreased readability and maintainability. Although it's available in C++, its use is generally discouraged in modern programming practices.

What is the behavior of a continue statement inside a while loop? 

  • It skips to the next iteration of the loop immediately. 
  • It breaks out of the loop. 
  • It restarts the loop from the very beginning. 
  • It throws an exception.
The continue statement inside loops, including a while loop, causes the program to skip any code following it in the current iteration and jump to the next iteration. It doesn't break out of the loop but just moves to the evaluation of the loop's condition for the next iteration.

You are developing a high-frequency trading system where performance is critical. Which data type should be chosen to store price data to ensure both performance and precision? 

  • int 
  • double 
  • char 
  • long double
In high-frequency trading, price data often requires floating-point precision due to fractional values. The double datatype strikes a balance between precision and performance. While long double offers more precision, it can be slower and is overkill for most financial data.