MCQ Bank
Which of the following is NOT a feature of Asana?
- A) File storage
- B) Team collaboration
- C) Task assignment
- D) Time tracking
What is the purpose of Asana's Inbox?
- A) To store project files
- B) To track time spent on tasks
- C) To receive notifications and updates
- D) To create task dependencies
What is Asana?
- A) A project management tool
- B) A file sharing platform
- C) A video conferencing software
- D) An email client
What is a project in Asana?
- A) A communication channel
- B) A project template
- C) A collection of tasks
- D) A team member's role
Which of the following is a good guideline for class design?
- A) Having a class with multiple responsibilities
- B) Making all class members public by default
- C) Creating classes that adhere to the Single Responsibility Principle (SRP)
- D) Using long and descriptive class names
Which of the following is an example of a good class design guideline?
- A) Avoiding encapsulation and exposing class internals directly
- B) Having large classes with hundreds of lines of code
- C) Avoiding code documentation and comments
- D) Using composition over inheritance when appropriate
Why is loose coupling considered a good design guideline for classes?
- A) It decreases the ease of testing and debugging
- B) It enhances code reusability and modularity
- C) It increases the chances of code conflicts and errors
- D) It reduces code readability and maintainability
What is a potential issue with a class having too many dependencies?
- A) It improves code maintainability and flexibility
- B) It increases code reusability and modularity
- C) It leads to high coupling and reduces testability
- D) It enhances code readability and reduces complexity
Which of the following is a bad practice for class design?
- A) Following the open-closed principle for class extension
- B) Using appropriate access modifiers for class members
- C) Having a class with only a single responsibility
- D) Overusing global variables within a class
What is the purpose of the final keyword in the following Java code snippet? public class Calculator { public static final double PI = 3.14159; public double calculateCircleArea(double radius) { return PI * radius * radius; } public static void main(String[] args) { Calculator calculator = new Calculator(); double area = calculator.calculateCircleArea(5); System.out.println("Area: " + area); } }
- A) It indicates that the PI variable cannot be changed.
- B) It prevents the area variable from being modified within the main method.
- C) It specifies that the calculateCircleArea method cannot be overridden.
- D) It ensures that the Calculator class cannot be extended.
Which of the following is a good practice for handling dynamic memory allocation in C++?
- A) Ignoring exception handling during memory allocation
- B) Utilizing smart pointers or RAII techniques
- C) Using raw pointers without explicit memory deallocation
- D) Relying on the operating system to automatically deallocate memory
What will be the output of the following code? #include <iostream> #include <vector> void modifyVector(std::vector<int>& vec) { vec.push_back(10); } int main() { std::vector<int> numbers; modifyVector(numbers); std::cout << numbers.size() << std::endl; return 0; }
- A) 1
- B) Compilation error
- C) 10
- D) 0
According to the MISRA C++ coding standard, why is it recommended to avoid dynamic memory allocation whenever possible?
- A) Dynamic memory allocation simplifies resource management.
- B) Dynamic memory allocation is more efficient than stack-based allocation.
- C) Dynamic memory allocation improves code readability.
- D) Dynamic memory allocation can lead to memory leaks and unpredictable behavior.
Which keyword is used in C++ to mark a function or destructor as non-throwing?
- A) noexcept
- B) noexception
- C) nonthrowing
- D) nothrow
What does the noexcept keyword signify in C++?
- A) The function will throw an exception.
- B) The function will handle exceptions internally.
- C) The function will not throw any exceptions.
- D) The function will ignore exception handling.
What is the potential risk associated with dynamic memory allocation?
- A) Increased program efficiency
- B) Deterministic behavior
- C) Improved code safety and reliability
- D) Resource exhaustion and memory leaks
What will be the output of the following code? #include <iostream> int main() { int* ptr = new int(5); std::cout << *ptr << std::endl; delete ptr; std::cout << *ptr << std::endl; return 0; }
- A) 5 and a runtime error
- B) 5 and a segmentation fault
- C) Compilation error
- D) 5 and a runtime error
Which aspect of software testing can be automated using Testing Tools?
- A) User interface design testing
- B) Performance testing
- C) Compatibility testing
- D) Documentation testing
What is one benefit of using Software Documentation Tools?
- A) Enhanced user interface design
- B) Improved data security
- C) Increased software development speed
- D) Streamlined project management
Which of the following is a feature commonly found in Software Documentation Tools?
- A) Code debugging capabilities
- B) Code debugging capabilities
- C) Data visualization tools
- D) Version control