MCQ Bank
Code should not be:
- A) aligned
- B) indented
- C) commented
- D) cryptic
In the N-Tire Architecture,the idea is to enhance scalability and -------------- by distributing both the data and the application using multiple server machines.
- A) Interoperability
- B) Performance
- C) Usability
- D) Integrity
Names representing methods and functions should be----and written in mixed case starting with -----case.
- A) Verb----lower
- B) Verb----upper
- C) Noun----upper
- D) Noun----lower
Class variables should never be declared public. Public variables violate which of the following:
- A) Encapsulation
- B) None of the given
- C) Information hiding
- D) Information hiding and Encapsulation
Constant values used in the program are called_________.
- A) Real Numbers
- B) Magic Numbers
- C) Positive Numbers
- D) Constant Numbers
In case of using unrelated operators in a single expression, _________ would be the best choice to prevent the logical errors.
- A) Parenthesis
- B) Indents
- C) Short Cuts
- D) Comments
Be very careful when you use functions with side effects – functions that change the values of the
________
- A) Variables
- B) Objects
- C) Structures
- D) Classes
Consider the following statement:
int a,b=10;
Which of the following is correct:
- A) Both variables "a" and "b" are initialized to 10
- B) Variable "b" is initialized to 10
- C) variable "a" is initialized to 10
- D) variables can not be initialized this way
Patterns are devices that allow programs to share knowledge about their -------------.
- A) Analysis
- B) Code
- C) Design
- D) Implementation
Global variables in C++ should always be referred to by using the
- A) Without an operator
- B) None of the given
- C) : operator
- D) :: operator
________ is a tool that can help us in reducing the size of individual functions.
- A) Abstraction
- B) Association
- C) Inheritance
- D) Modularity
MVC stands for ---------------
- A) Model View Controller
- B) Modern View Center
- C) Model View Center
- D) Modern View Controller
The order in which bytes of one word are stored is _________ dependent
- A) software
- B) hardware
- C) syntax
- D) language
-----provides a unified interface to a set of interfaces in a sub-system.
- A) All of the above
- B) Observer Pattern
- C) Singleton Pattern
- D) Façade Pattern
Which of the following shows a commented statement in C++
- A) // Ans = first + second
- B) \\ Ans = first + second
- C) /# Ans = first + second
- D) # Ans = first + second
if (e.Title() == “CEO” || e.Salary() > 10000)
in the above statement if (e.Title()=="CEO") is TRUE then
- A) Second part is not evaluated but e.Salary() is called
- B) Second part must also be TRUE
- C) Second part is always evaluated
- D) Second part is not evaluated
When programmers use shortcuts and cryptic codes in their program, ________ becomes a major problem.
- A) Availability
- B) Reusability
- C) Maintenance
- D) Readability
When a small set of functions (which use each other) is so overwhelmingly the bottleneck, there are two alternatives:
- A) changed programming language OR compiler at least
- B) use a better algorithm OR re-write the code
- C) debug the code OR place assertions in code
- D) remove the functions OR add more functions
x = 0; // x is floating pt
Which rewritten form of above line of code is more in line with the self-documentation philosophy than the code above.
- A) x = ‘\0’
- B) x = false
- C) x = NULL
- D) x = 0.0;
The idea behind exception handling is to raise some error flag every time ________
- A) The code compiles
- B) Something goes wrong
- C) The code links
- D) Memory is allocated