What is the purpose of using inline functions in C?

  • Enable recursive functions
  • Improve code maintainability
  • Increase code size
  • Reduce function call overhead
Inline functions in C reduce the overhead of function calls, as the code is inserted directly in place of the function call. This can improve performance.

What happens to the memory allocation when you define variables inside a union?

  • Variables are allocated separate memory locations
  • Variables are automatically allocated on the heap
  • Variables are stored in a separate file
  • Variables share the same memory location
Variables defined inside a union share the same memory location, so only one variable's value is stored at any given time. Changing the value of one variable affects others in the union.

In C++, function overloading allows multiple functions to have the same name but with different ________.

  • parameters
  • return types
  • function names
  • access specifiers
The correct answer is return types. In C++, function overloading is when you have multiple functions with the same name but differing in their parameter types or the number of parameters. However, their return types must be different to distinguish them. The other options are not relevant to function overloading.

What is a potential consequence of not freeing dynamically allocated memory in a long-running C program?

  • Buffer overflow
  • Memory leaks
  • Null pointer dereference
  • Stack overflow
When dynamically allocated memory isn't freed, it leads to memory leaks. This means that the memory remains allocated and cannot be reclaimed for other purposes, which can result in a program consuming more and more memory over time.

The keyword ________ is used to declare a variable that retains its value between successive calls to the functions in which it is declared.

  • auto
  • extern
  • register
  • static
In C, the static keyword is used to declare a variable that retains its value between successive calls to the functions in which it is declared. This keyword is used to create a local variable with a persistent value, maintaining its state across function calls.

The function ________ can be unsafe to use as it does not check for buffer overflow while reading a string in C.

  • fgets
  • getchar
  • gets
  • scanf
The correct answer is fgets. gets is unsafe due to buffer overflow issues, scanf can be problematic when not used carefully, and getchar is used for character input, not strings. fgets is a safer choice for reading strings.

The typedef keyword can be used to simplify the declaration of ________ in C.

  • Data structures
  • Functions
  • Macros
  • Variables
The typedef keyword in C is commonly used to simplify the declaration of user-defined data structures, making it easier to work with complex data types.

An array of strings in C can be declared as a ________.

  • 2D array
  • grid
  • matrix
  • stack
An array of strings in C can be declared as a 2D array. Each row of the 2D array represents a string, and you can have multiple strings stored within the same data structure.

The keyword ________ is used in C to define a constant.

  • constant
  • define
  • identifier
  • value
In C, the keyword 'const' is used to define a constant. It is used to declare variables as constant, and their values cannot be changed after declaration.

Dynamic testing techniques are employed when the software is in which state?

  • After Deployment
  • Before Compilation
  • During Execution
  • While Being Designed
Dynamic testing techniques involve the actual execution of the software. It's performed when the code is run, as opposed to static testing which is performed without executing the code. Dynamic testing validates the software system in a runtime environment.

The _______ principle of software testing states that testing all possible combinations and scenarios in a software application is not feasible.

  • Boundary Value
  • Exhaustiveness
  • Pareto Principle
  • Pesticide Paradox
The "Exhaustiveness" principle suggests that it's impractical and non-feasible to test all possible combinations and scenarios in a software application due to constraints like time, resources, and the infinite possibilities. Instead, focused and effective testing is carried out based on risk and priority.

Which type of testing primarily focuses on how intuitive and user-friendly an application is?

  • Functional Testing
  • Performance Testing
  • Security Testing
  • Usability Testing
Usability Testing is a type of software testing where the primary focus is to ensure that the application is user-friendly, intuitive, and easy to understand. It ensures that the end-users can efficiently complete their intended tasks without facing unnecessary obstacles or confusions.