U.G.C. NET Exam. 4 December, 2019 Paper II (COMPUTER SCIENCE & APPLICATIONS)

Total Questions: 100

71. Which of the following statements are true regarding C++?

(A) Overloading gives the capability to an existing operator to operate on other data types.
(B) Inheritance in object oriented programming provides support to reusability.
(C) When object of a derived class is defined first the constructor of derived class is executed then constructor of a base class is executed.
(D) Overloading is a type of polymorphism.
Choose the correct option from those given below:

Correct Answer: (c) (A), (B) and (D) only
Solution:

Statement (a) : Overloading gives the capability to an existing operator to operate on other data types. This statement is incorrect. Operator overloading is a type of polymorphism in which an operator is overloaded to give a different meaning or user defined meaning. It allows to change the way an operator can work. It gives the capability to an existing operator to operate on other data types.
Statement (b): Inheritance in object oriented programming provides support to reusability. This statement is correct. When a class acquires the properties of another class, this is known as inheritance. The class which acquire the properties and method is known as derived class and other one is parent or base class. Inheritance another name for reusability.
Statement (c): When object of a derived class is defined, first the constructor of derived class is executed then constructor of a base class is executed then constructor of a base class is executed. This statement is incorrect constructor is a special member function of class that is automatically executed or called when objects of that class will be created. As when object or derived class is defined automatically derived class constructor and base class constructor will execute inside them.
Statement (d) : Overloading is a type of polymorphism. This statement is correct. Operator is a type of polymorphism in which an operator is overloaded to give a different meaning or user defined meaning. It allows to change the way an operator can work.

72. Which of the following are legal statements in C programming language?

(A) int * P = &44;
(B) int * P = &r;
(C) int P = &a;
(D) int P = a;
Choose the correct option:

Correct Answer: (c) (B) and (D)
Solution:

a - Pointer variable P cannot store address of a value which is not assigned to a variable.
b - Pointer variable P can store address of variable r.
c - Integer variable P cannot store address of variable a.
d - Integer variable P can store value of variable a.
Hence int*P = & r ; and int P = a; are legal statements in C programming language

73. Two concurrent executing transactions T₁ and T₂ are allowed to update same stock item say 'A' in an uncontrolled manner. In such scenario, following problems may occur:

(A) Dirty read problem
(B) Lose update problem
(C) Transaction failure
(D) Inconsistent database state
Which of the following option is correct if database system has no concurrency module and allows concurrent execution of above two transactions?

Correct Answer: (d) (A), (B) and (D) only
Solution:

Problem & that can occur during concurrent execution of two transactions in an uncontrolled manner.
(a) Lost update problem: Lost update problem occurs when two transactions that access the same database items have their operations interleaved in a way that makes the value of some database item incorrect.
(b) Dirty read Problem: It occurs when a transaction is allowed to retrieve or update a record that has been updated by another transaction. Because it has not yet been committed there is always a possibility that it will never be committed but rather roll back.
(c) Inconsistent database state: It occurs when a transaction reads several values but a second transaction updates some of these values during the execution of first. This causes an inconsistency.
For example: If one transaction is calculating an aggregate summary function on a number of records while other transactions are updating some of records.

74. Identify the circumstances under which preemptive CPU scheduling is used:

(A) A process switches from Running state to Ready state
(B) A process switches from Waiting state to Ready state
(C) A process completes its execution
(D) A process switches from Ready to Waiting state
Choose the correct option:

Correct Answer: (a) (A) and (B)
Solution:

To understand pre-emptive scheduling we first need to understand the process state diagram.
Scheduling is performed from when the process is taken from ready state on to the running state.
Hence CPU scheduling decisions take place under one of four conditions.
(1) Process switch from running state to waiting state.
(2) Process switch from running state to Ready State.
(3) Process switch from waiting state to ready state (statement b)
(4) Process termination.
Statement C- No need for preemptive scheduling as execution is complete.
Statement D- Process cannot switch from Ready state to waiting state.

75. The following multithreaded algorithm computes transpose of a matrix in parallel:

p Trans (X, Y, N)
if N = 1
then Y[1, 1] ← X [1, 1]

Correct Answer: (a)
Solution:

76. Consider the following statements:

(A) The running time of dynamic programming algorithm is always θ(ρ) where ρ is number of sub problems.
(B) When a recurrence relation has cyclic dependency. It is impossible to use that recurrence relation (unmodified) in a correct dynamic program.
(C) For a dynamic programming algorithm computing all values in a bottom-up fashion is asymptotically faster than using recursion and memorization.
(D) If a problem X can be reduced to a known NP hard problem then X must be NP hard. Which of the statement(s) is

Correct Answer: (b) Only (B)
Solution:

The running time of dynamic programming algorithm is always θ
(ρ) where P is number of sub problems. This statement is incorrect running time for dynamic algorithms is the number of sub-problems multiplies with time for each sub-problem. It means running time of dynamic programming algorithms is O(1).
(b) When a recurrence relation has cyclic dependency it is impossible to use that recurrence relation (unmodified) in a correct dynamic program. Cyclic dependency is relation between two or more modules which depends on each other indirectly or directly, these are mutually recursive. So, given statement is correct.
(c) For a dynamic programming algorithms, computing all values in a bottom up fashion is asymptotically faster than using recursion and memorization. This statement is incorrect for a dynamic programming algorithm, computing all values using recursion and memorization takes less time than computing in bottom up fashion.
(d) If a problem X can be reduced to known NP-hard problem, then X must be NP hard.
If a problem X can be reduced to a known NP hard problem, then X must be NP complete not NP hard. So given statement is incorrect.

77. Consider the following statements:

(A) Fiber optic cable is much lighter than copper cable
(B) Fiber optic cable is not affected by power surges or electromagnetic interference.
(C) Optical transmission is inherently bidirectional
Which of the statements is (are) correct?

Correct Answer: (a) Only (A) and (B)
Solution:

only (A) and (B) is correct→
(a) Fiber optic cable is much lighter than copper cable. Given statement is correct. Fiber optic cable transmit signal in the form of light pulses. they can transmit data at higher speed than copper cables and these are lighter than copper cables. Also fiber optic cable have higher bandwidth.
(b) Fiber optic cable is not affected by power surges or electromagnetic interference. This statement is correct fiber optic cables are non metallic and they transmit signal in the form of light pulses. that's why they are immune to electromagnetic interference. Integrity of signal is not affected by electrical noise.
(c) Optical transmission is inherently bidirectional. This statement is incorrect. Two optical modules are connected by single fiber cable which supports unidirectional communication for bidirectional communication, two cables will be required.

78. Consider the following statements:

(A) Windows Azure is a cloud based operating system
(B) Google App Engine is an integrated set of online services for consumers to communicate and share with others.
(C) Amazon Cloud Front is a web service for content delivery.
Which of the statements is (are) correct? 

Correct Answer: (b) Only (A) and (C)
Solution:

(a) Window Azure is a cloud-based operating system. This statement is correct. Windows Azure is a cloud based operating system which enables running of business applications, services and work load in the cloud itself. It mainly deals with the foundation of running applications and keeping the data on the cloud.
(b) Google App Engine- is an integrated set of online services for consumers to communicate and share with others. Google app engine is PaaS(platform as a service) product. It provides web developing services to developers. Apps must be written in Java or python. So this statement is incorrect.
(c) Amazon Cloud Front- is a web service content delivery. Amazon cloud front is a fast content delivery network service that securely delivers data, video applications and APIs to customers.Cloud front is integrated with AWS global infrastructure and services. So statement is correct.

79. Consider the following statements with respect to network security:

(A) Message confidentiality means that the sender and the receiver expect privacy.
(B) Message integrity means that the data must arrive at the receiver exactly as they were sent. (C) Message authentication means the receiver is ensured that the message is coming from the intended sender.
Which of the statements is (are) correct?

Correct Answer: (d) (A), (B) and (C)
Solution:

(a) message confidentiality means that the sender and the receiver expect privacy. Message confidentiality means that only sender and intended receiver should be able to access the contents of a message. Confidentiality gets compromised if an unauthorized person is able to access a message. It means sender and receiver expect privacy.
(b) Message integrity means that the data must arrive at the receiver exactly as they were sent. When the contents of a message are changed after the sender sends it, but before it reaches the intended recipient, we say that the integrity of the message is lost. It means that the data must arrive at the receiver exactly as they were sent.
(c) Message authentication means the receiver is ensured that the message is coming from the intended sender.
Authentication mechanisms help establish proof of identities. The authentication process ensures that the origin of an electronic message or document is correctly identified. It means that receiver is ensured that the message is coming from the intended sender.

80. Consider the following:

(A) Trapping at local maxima
(B) Reaching a plateau
(C) Traversal along the ridge
Which of the following option represents shortcomings of the hill climbing algorithm?

Correct Answer: (d) (A), (B) and (C)
Solution:

HILL CLIMBING ALGORITHM:- In hill climbing algorithm at each point in the search path a successor node that appears to lead most quickly to the top of the hill or goal is selected for exploration. In this method of searching, the generate and test method is augmented by a heuristic foundation which measures the closeness of the current state to the goal state.
Explanation:- Problems in hill claiming are:
(1) Local maximum: It is a state which is better than of its neighbors but is not better than some other states which are farther away. Solution of this problem is backtracking.
(2) Plateau: It is a that area of search space in which a whole set of neighboring states have the same value. On a plateau, it is not possible to determine the best direction in which to move.
(3) Ridge:- It is an area of search space which is higher them the surrounding areas and that itself has a slope.