In C++, a size of long double is at least _______ bytes. 

  • 10 
  • 12 
  • 16
In C++, the size of long double is compiler-dependent. However, according to the C++ standard, it is at least 8 bytes or the size of a double, whichever is greater. Some compilers may allocate more.

Using templates excessively can lead to an issue known as _______. 

  • recursion 
  • template bloat 
  • overloading 
  • specialization
Excessive use of templates can result in code that has much larger compiled sizes than equivalent non-template code. This phenomenon, where the binary gets bloated due to templates, is known as template bloat.

When an enum is declared, it creates a new _______. 

  • function 
  • data type 
  • variable 
  • class
When an enumeration (enum) is declared in C++, it essentially creates a new user-defined data type. This allows the programmer to define variables of this enumeration type and assign any of its enumerator values to these variables.

Which smart pointer in C++ retains shared ownership of an object through a pointer? 

  • auto_ptr 
  • unique_ptr 
  • weak_ptr 
  • shared_ptr
shared_ptr is a type of smart pointer in C++ that retains shared ownership of an object. This means multiple shared_ptr objects can own the same object, and the object will only be destroyed when the last shared_ptr owning it is destroyed or reset. This helps in preventing memory leaks and ensuring safer memory management.

What is the size (in bytes) of an int data type in most C++ implementations? 

  • 8
In most C++ implementations, particularly those that follow the x86 architecture and many 32-bit systems, an int data type occupies 4 bytes in memory. However, it's essential to note that the size can vary based on the platform and compiler.

How do AngularJS expressions differ from JavaScript expressions?

  • AngularJS expressions are enclosed in double curly braces, while JavaScript expressions use parentheses.
  • AngularJS expressions can only be used in HTML attributes, while JavaScript expressions are used in script tags.
  • AngularJS expressions must be enclosed in single quotes, unlike JavaScript expressions.
  • AngularJS expressions support data binding and are evaluated in the context of AngularJS scopes.
AngularJS expressions differ from JavaScript expressions in that they support data binding and are evaluated in the context of AngularJS scopes. This allows for dynamic updating of the view when the underlying data changes. Understanding this distinction is crucial for effective use of expressions in AngularJS applications.

While creating a networking application, you find a need to define a data type that can hold various data related to a network packet, such as its ID, source, destination, and payload. You also require a function to calculate the checksum of the packet. Which user-defined data type in C++ would be best suited for this use case? 

  • Class 
  • Struct 
  • Union 
  • Namespace
Classes in C++ are versatile data structures that can encapsulate both data members and member functions. In this scenario, since we need to define various data attributes for the packet and also include a function to calculate checksum, a class is the most appropriate choice.

In C++, an enum can be used to create _______. 

  • classes 
  • named constants 
  • functions 
  • variables
In C++, an enumeration (enum) is a user-defined data type that consists of integral constants. By default, the first enumerator has the value 0, and the value of each successive enumerator is increased by one. They are essentially a way to create named integral constants.

The process of _________ in $scope is essential for detecting changes and updating the view accordingly.

  • Compilation
  • Data Binding
  • Dependency Injection
  • Event Handling
The process of Data Binding in $scope is essential for detecting changes in the application data and updating the view accordingly. Data Binding is a core concept in AngularJS that establishes a connection between the model (data) and the view (UI). It ensures that any changes in the model are automatically reflected in the view, providing a seamless and reactive user experience. Understanding Data Binding is crucial for building dynamic and responsive AngularJS applications.

In a complex AngularJS application, how does the MVC architecture aid in managing state and user interactions effectively?

  • Bypasses state management altogether
  • Centralizes state management in the Controller
  • Delegates state management to the View
  • Distributes state management across multiple components
In a complex AngularJS application, the MVC architecture aids in managing state and user interactions effectively by centralizing state management in the Controller. The Controller acts as the central hub for handling user input, managing application state, and coordinating communication between the Model and View. This centralized approach simplifies state management, enhances code maintainability, and improves the overall structure of the application. Understanding the role of the Controller in state management is essential for building scalable and maintainable AngularJS applications.