## Nielit Scientist-B IT 22-07-2017

Question 1 |

Given an undirected graph G with V vertices and E edges, the sum of the degrees of all vertices is

E | |

2E | |

V | |

2V |

Question 1 Explanation:

**Theorem (Sum of Degrees of Vertices Theorem):**

Suppose a graph has n vertices with degrees d

_{1}, d

_{2}, d

_{ 3}, ..., d

_{ n}.

Add together all degrees to get a new number

d

_{1}+ d

_{2}+ d

_{ 3}+ . .. + d

_{ n}= D

_{v}. Then D

_{ v}= 2 e .

In words, for any graph the sum of the degrees of the vertices equals twice the number of edges.

Question 2 |

Which of the following is an advantage of adjacency list representation over adjacency matrix representation of a graph?

In adjacency list representation, space is saved for sparse graphs. | |

Deleting a vertex in adjacency list representation is easier than adjacency matrix representation | |

Adding a vertex in adjacency list representation is easier than adjacency matrix representation. | |

All of the option |

Question 2 Explanation:

Adjacency Matrix

● Uses O(n

● It fast to lookup and check for presence or absence of a specific edge between any two nodes O(1)

● It slow to iterate over all edges

● It slow to add/delete a node is a complex operation O(n

Adjacency List

● Use memory pending on the number of edges (not number of nodes), Which might save a lot of memory if the adjacency matrix is a sparse

● Finding the presence or absence specific edge between any two nodes Is slightly slower than with the matrix O(k) where k number of neighbors nodes

● It is fast to iterate over all edges,because you can access any node neighbors directly

● It is fast to add/delete a node is easier than the matrix representation

● Uses O(n

^{ 2} ) memory● It fast to lookup and check for presence or absence of a specific edge between any two nodes O(1)

● It slow to iterate over all edges

● It slow to add/delete a node is a complex operation O(n

^{2} )Adjacency List

● Use memory pending on the number of edges (not number of nodes), Which might save a lot of memory if the adjacency matrix is a sparse

● Finding the presence or absence specific edge between any two nodes Is slightly slower than with the matrix O(k) where k number of neighbors nodes

● It is fast to iterate over all edges,because you can access any node neighbors directly

● It is fast to add/delete a node is easier than the matrix representation

Question 3 |

A path in graph G, which contains every vertex of G and only Once?

Euler circuit | |

Hamiltonian path | |

Euler Path | |

Hamiltonian Circuit |

Question 3 Explanation:

● Hamiltonian path, also called a Hamilton path, is a graph path between two vertices of a graph that visits each vertex exactly once. If a Hamiltonian path exists whose endpoints are adjacent, then the resulting graph cycle is called a Hamiltonian cycle (or Hamiltonian cycle)

● An Euler path is a path that uses every edge of a graph exactly once. An Euler circuit is a circuit that uses every edge of a graph exactly once.

● An Euler path starts and ends at different vertices.

● An Euler circuit starts and ends at the same vertex.

● An Euler path is a path that uses every edge of a graph exactly once. An Euler circuit is a circuit that uses every edge of a graph exactly once.

● An Euler path starts and ends at different vertices.

● An Euler circuit starts and ends at the same vertex.

Question 4 |

what are the appropriate data structures for graph traversal using Breadth First Search(BFS) and Depth First Search(DFS) algorithms?

Stack for BFS and Queue for DFS | |

Queue for BFS and Stack for DFS | |

Stack for BFS and Stack for DFS | |

Queue for BFS and Queue for DFS |

Question 4 Explanation:

● Depth First Search (DFS) algorithm traverses a graph in a depthward motion and uses a stack to remember to get the next vertex to start a search, when a dead end occurs in any iteration.

● Breadth-first search (BFS) is an algorithm for traversing or searching tree or graph data structures. It starts at the tree root (or some arbitrary node of a graph, sometimes referred to as a 'search key'), and explores all of the neighbor nodes at the present depth prior to moving on to the nodes at the next depth level.

● Breadth-first search (BFS) is an algorithm for traversing or searching tree or graph data structures. It starts at the tree root (or some arbitrary node of a graph, sometimes referred to as a 'search key'), and explores all of the neighbor nodes at the present depth prior to moving on to the nodes at the next depth level.

Question 5 |

In a given following graph among the following sequences:

i)abeghf

ii)abfehg

iii)abfhge

iv)afghbe

Which are depth first traversals of the above graph?

i)abeghf

ii)abfehg

iii)abfhge

iv)afghbe

Which are depth first traversals of the above graph?

I,II and IV only | |

I and IV only | |

II,III and IV only | |

I,III and IV only |

Question 5 Explanation:

The basic idea of DFS is

● Pick a starting node and push all its adjacent nodes into a stack.

● Pop a node from stack to select the next node to visit and push all its adjacent nodes into a stack.

● Repeat this process until the stack is empty. However, ensure that the nodes that are visited are marked.

● This will prevent you from visiting the same node more than once. If you do not mark the nodes that are visited and you visit the same node more than once, you may end up in an infinite loop.

● Pick a starting node and push all its adjacent nodes into a stack.

● Pop a node from stack to select the next node to visit and push all its adjacent nodes into a stack.

● Repeat this process until the stack is empty. However, ensure that the nodes that are visited are marked.

● This will prevent you from visiting the same node more than once. If you do not mark the nodes that are visited and you visit the same node more than once, you may end up in an infinite loop.

Question 6 |

Considering the following graph, which one of the following set of edged represents all the bridges of the given graph?

(a,b)(e,f) | |

(a,b),(a,c) | |

(c,d)(d,h) | |

(a,b) |

Question 6 Explanation:

● A bridge ,cut-edge, or cut arc is an edge of a graph whose deletion increases its number of connected components.

● Equivalently, an edge is a bridge if and only if it is not contained in any cycle.

● The removal of edges (a,b) and (e,f) makes graph disconnected.

● Equivalently, an edge is a bridge if and only if it is not contained in any cycle.

● The removal of edges (a,b) and (e,f) makes graph disconnected.

Question 7 |

Which of the following statements is/are TRUE?

S1: The existence of an Euler circuit implies that an euler path exists.

S2: The existence of an Euler path implies that an Euler circuit exists.

S1: The existence of an Euler circuit implies that an euler path exists.

S2: The existence of an Euler path implies that an Euler circuit exists.

S1 is true | |

S2 is true | |

S1 and S2 both are true | |

S1 and S2 both are false |

Question 7 Explanation:

An Euler circuit in a graph G is a simple circuit containing every edge of G exactly once

An Euler path in G is a simple path containing every edge of G exactly once.

An Euler path starts and ends at different vertices.

An Euler circuit starts and ends at the same vertex.

An Euler path in G is a simple path containing every edge of G exactly once.

An Euler path starts and ends at different vertices.

An Euler circuit starts and ends at the same vertex.

Question 8 |

A connected planar graph divides the plane into a number of regions. If the graph has eight vertices and these are linked by 13 edges, then the number of regions is:

5 | |

6 | |

7 | |

8 |

Question 8 Explanation:

Use Euler's formula ,V−E+R=2

Where V is the number of vertices, E is the number of edges, and R is the number of regions.

R=2-V+E=2-8+13=7

Where V is the number of vertices, E is the number of edges, and R is the number of regions.

R=2-V+E=2-8+13=7

Question 9 |

Power set of empty set has exactly__subset

One | |

Two | |

Zero | |

Three |

Question 9 Explanation:

● The collection of all subsets of a set A is called the power set of A.

● The empty set is the unique set having no elements; its size or cardinality (count of elements in a set) is zero

● Common notations for the empty set include "{}", " ", and "∅".

● The empty set is the unique set having no elements; its size or cardinality (count of elements in a set) is zero

● Common notations for the empty set include "{}", " ", and "∅".

Question 10 |

What is the cartesian product of A={1,2} and B={a,b}?

{(1,a),(1,b),(2,a),(b,b)} | |

{(1,1),(2,2),(a,a),(b,b)} | |

{(1,a),(2,a),(1,b),(2,b)} | |

{(1,1),(a,a),(2,a),(1,b)} |

Question 10 Explanation:

● A Cartesian product is a mathematical operation that returns a set (or product set or simply product) from multiple sets. That is, for sets A and B, the Cartesian product A × B is the set of all ordered pairs (a, b) where a ∈ A and b ∈ B.

● In the question, Set A consists of two elements and Set B consists of two elements. So the total ordered pairs are four.

● Each ordered pair consists of one element from Set-A and another element from Set-B.

● In the question, Set A consists of two elements and Set B consists of two elements. So the total ordered pairs are four.

● Each ordered pair consists of one element from Set-A and another element from Set-B.

Question 11 |

What is the cardinality of the power set of the set {0,1,2}?

8 | |

6 | |

7 | |

9 |

Question 11 Explanation:

The cardinality of a set is defined as the total number of distinct items in that set and power set is defined as the set of all subsets of a set.

Power set consists of {}, {0}, {1}, {2}, {0,1}, {0,2}, {1,2}, {0,1,2}

So power set consists of all unique items then cardinality is 8

Power set consists of {}, {0}, {1}, {2}, {0,1}, {0,2}, {1,2}, {0,1,2}

So power set consists of all unique items then cardinality is 8

Question 12 |

Let G be a simple connected planar graph with 13 vertices and 19 edges. then the number of faces in the planar embedding of the graph is

6 | |

8 | |

9 | |

13 |

Question 12 Explanation:

● Use Euler's formula ,V−E+R=2

● Where V is the number of vertices, E is the number of edges, and R is the number of regions.

● R=2-V+E=2-13+19=8

● We can also term region as face

● Where V is the number of vertices, E is the number of edges, and R is the number of regions.

● R=2-V+E=2-13+19=8

● We can also term region as face

Question 13 |

Which of the following statements is false?

(P⋀Q)V(~P⋀Q)V(P⋀~Q) is equal to ~Q⋀~P | |

(P⋀Q)V(~P⋀Q)V(P⋀~Q) is equal to QVP | |

(P⋀Q)V(~P⋀Q)V(P⋀~Q) is equal to QV(P⋀~q) | |

(P⋀Q)V(~P⋀Q)V(P⋀~Q) is equal to PV(Q⋀~p) |

Question 13 Explanation:

One simple method is, by using truth table we can find the statement is true or not.

The last two columns of the above table are different. So option A is false.

The last two columns of the above table are different. So option A is false.

Question 14 |

There are four bus lines between A and B; And three bus lines between B and C The number of way a person roundtrip by bus from A to C by way of B will be

12 | |

7 | |

144 | |

264 |

Question 14 Explanation:

The number of bus lines between a and b =4

The number of bus lines between b and c =3

The number of possible combinations between a and c going through b are 4 * 3 = 12.

if you're talking about round trip, he has 12 possible ways to get there and 12 possible ways to get back, so the total possible ways is 12 * 12 = 144.

The number of bus lines between b and c =3

The number of possible combinations between a and c going through b are 4 * 3 = 12.

if you're talking about round trip, he has 12 possible ways to get there and 12 possible ways to get back, so the total possible ways is 12 * 12 = 144.

Question 15 |

The number of diagonals that can be drawn by joining the vertices of an octagon is

28 | |

48 | |

20 | |

None of the option |

Question 15 Explanation:

Octagon consists of the 8 vertices and we can draw 5 diagonals

So, we can construct 5*8 = 40 diagonals.

But we have constructed each diagonal twice, once from each of its ends. Thus there are 20 diagonals in a regular octagon.

So, we can construct 5*8 = 40 diagonals.

But we have constructed each diagonal twice, once from each of its ends. Thus there are 20 diagonals in a regular octagon.

Question 16 |

A partial ordered relation is transitive, reflexive and

Antisymmetric | |

bisymmetric | |

anti reflexive | |

Asymmetric |

Question 16 Explanation:

● Let R be a binary relation on a set A.

● R is antisymmetric if for all x,y A, if xRy and yRx, then x=y.

● R is a partial order relation if R is reflexive, antisymmetric and transitive.

● R is antisymmetric if for all x,y A, if xRy and yRx, then x=y.

● R is a partial order relation if R is reflexive, antisymmetric and transitive.

Question 17 |

In tuple relational calculus P1 → p2 is equivalent to

~P1 V P2 | |

P1 V p2 | |

P1 ⋀ P2 | |

P1 ⋀ ~P2 |

Question 17 Explanation:

In tuple relational calculus P1→ P2 is equivalent to ¬P1 V P2. (The logical implication expression A -> B, meaning if A then B,is equivalent to ¬A V B)

Question 18 |

If B is a Boolean algebra, then which of the following is true?

B is a finite but not complemented lattice | |

B is a finite, Complemented and distributive lattice | |

B is a finite,distributive but not complemented lattice | |

B is not distributive lattice |

Question 18 Explanation:

Distributive property of boolean algebra

(i)a.(b + c) =a.b + a.c

(ii) a+(b.c) = (a + b).(a + c)

Boolean algebra properites:

(i)a.(b + c) =a.b + a.c

(ii) a+(b.c) = (a + b).(a + c)

Boolean algebra properites:

Question 19 |

If R is a relation in relational data Model and A1,A2,..An are the attributes of relation R, what is the cardinality of R expressed in terms of domain of attributes?

|R|<=|dom(A1)X dom(A2)..dom(An)| | |

|R|>=|dom(A1)X dom(A2)..dom(An)| | |

|R|=max(|dom(A1)|,|dom(A2)|,..|dom(An)|) | |

|R|=min(|dom(A1)|,|dom(A2)|,..|dom(An)|) |

Question 19 Explanation:

● In the context of databases, cardinality refers to the uniqueness of data values contained in a column.

● Cardinality refers to a number. It gives the number of unique values that appear in the table for a particular column.

● For eg: you have a table called Person with column Gender. Gender column can have values either 'Male' or 'Female''.

● Then the cardinality of Gender column is 2, since there are only two unique values that could possibly appear in that column – Male and Female.

● Cardinality refers to a number. It gives the number of unique values that appear in the table for a particular column.

● For eg: you have a table called Person with column Gender. Gender column can have values either 'Male' or 'Female''.

● Then the cardinality of Gender column is 2, since there are only two unique values that could possibly appear in that column – Male and Female.

Question 20 |

If A and B are two sets and A U B = A ∩ B then

A= ∅ | |

B= ∅ | |

A != B | |

A=B |

Question 20 Explanation:

● For example, Set A={1,2,3} and Set B={1,2,3}

● AUB={1,2,3}

● A ∩ B ={1,2,3}

● If two sets consists of same elements then A U B = A ∩ B

● AUB={1,2,3}

● A ∩ B ={1,2,3}

● If two sets consists of same elements then A U B = A ∩ B

Question 21 |

The relation {(1,2),(1,3)(3,1),(1,1),(3,3),(3,2),(1,4),(4,2),(3,4)} is

Reflexive | |

Transitive | |

Symmetric | |

Asymmetric |

Question 21 Explanation:

Given set consists of elements a,b, and c.

The following conditions need to satisfy for each property.

a = a (reflexive property),

if a = b then b = a (symmetric property), and

if a = b and b = c then a = c (transitive property).

an asymmetric relation is a binary relation on a set X where:For all a and b in X, if a is related to b, then b is not related to a

The above relation is not reflexive because there is no ordered pairs (2,2) and (4,4)

The above relation is not Symmetric because if (1,2) present means the relation should consists of (2,1) but there is no such ordered pair in the relation.

Asymmetric property also invalid because of (1,3) and (3,1) ordered pairs.

The following conditions need to satisfy for each property.

a = a (reflexive property),

if a = b then b = a (symmetric property), and

if a = b and b = c then a = c (transitive property).

an asymmetric relation is a binary relation on a set X where:For all a and b in X, if a is related to b, then b is not related to a

The above relation is not reflexive because there is no ordered pairs (2,2) and (4,4)

The above relation is not Symmetric because if (1,2) present means the relation should consists of (2,1) but there is no such ordered pair in the relation.

Asymmetric property also invalid because of (1,3) and (3,1) ordered pairs.

Question 22 |

If an SQl query involves NOT,AND,OR with no parenthesis

NOT will be evaluated first; AND will be evaluated second;OR will
be evaluated last | |

NOT will be evaluated first; OR will be evaluated second;AND will
be evaluated last | |

AND will be evaluated first; OR will be evaluated second;NOT will
be evaluated last | |

The order of occurrence determines the order of evaluation |

Question 22 Explanation:

**Table: SQL Operator Precedence**

**The above table shows the SQL operator precedence.**

Question 23 |

The probability that top and bottom cards of a randomly shuffled deck are both aces is:

4/52 X 4/52 | |

4/52 X 3/52 | |

4/52 X 3/51 | |

4/52 X 4/51 |

Question 23 Explanation:

E 1 : First card being ace

E 2 : Last card being ace

Note that E 1 and E 2 are dependent events, i.e., probability of last card being ace if first is ace will be lesser than the probability of last card being ace if first card is not ace.

So, probability of first card being ace = 4/52

Probability of last card being ace given that first card is ace is,

P(E 2 / E 1 ) = 3/51

∴ P(E 1 and E 2 ) = P(E 1 ) ⋅ P(E 2 / E 1 ) = 4/52 * 3/51

E 2 : Last card being ace

Note that E 1 and E 2 are dependent events, i.e., probability of last card being ace if first is ace will be lesser than the probability of last card being ace if first card is not ace.

So, probability of first card being ace = 4/52

Probability of last card being ace given that first card is ace is,

P(E 2 / E 1 ) = 3/51

∴ P(E 1 and E 2 ) = P(E 1 ) ⋅ P(E 2 / E 1 ) = 4/52 * 3/51

Question 24 |

The coupling between different modules of a software is categorized as follows:

I. Content coupling

II.Common coupling

III.Control coupling

IV.Stamp Coupling

V.Data Coupling

Coupling between modules can be ranked in the order of strongest(lease desirable) to weakes(most desirable) as follows:

I. Content coupling

II.Common coupling

III.Control coupling

IV.Stamp Coupling

V.Data Coupling

Coupling between modules can be ranked in the order of strongest(lease desirable) to weakes(most desirable) as follows:

I-II-III-IV-V | |

V-IV-III-II-I | |

I-III-V-II-IV | |

IV-II-V-III-I |

Question 24 Explanation:

One of the most widely used for software and systems is Myers’ classification, which defines seven levels of coupling, from tightest to loosest:

● Content coupling - modules rely on each others’ internal data or internal organization

● Common coupling - modules share the same global data

● External coupling - modules share an externally imposed data format, communication protocol or device interface

● Control coupling - one module controls the flow of another, such as by passing it a flag or other information

● Stamp coupling - modules share a composite data structure but use different parts of it

● Data coupling - modules share data through parameters, such as in a subroutine call

● Message coupling - modules communicate by passing messages

● Content coupling - modules rely on each others’ internal data or internal organization

● Common coupling - modules share the same global data

● External coupling - modules share an externally imposed data format, communication protocol or device interface

● Control coupling - one module controls the flow of another, such as by passing it a flag or other information

● Stamp coupling - modules share a composite data structure but use different parts of it

● Data coupling - modules share data through parameters, such as in a subroutine call

● Message coupling - modules communicate by passing messages

Question 25 |

Which of the following statements are TRUE?

I. The context diagram should be identified clearly at all levels of DFDs

II.Control information should not be represented in a DFD

III. Control information should not be represented in a DFD

IV. A data store can be connected either to another datastore or to an external entity.

I. The context diagram should be identified clearly at all levels of DFDs

II.Control information should not be represented in a DFD

III. Control information should not be represented in a DFD

IV. A data store can be connected either to another datastore or to an external entity.

II and IV | |

II and III | |

I and III | |

I,II and III |

Question 25 Explanation:

● A system context diagram (SCD) in engineering is a diagram that defines the boundary between the system, or part of a system, and its environment, showing the entities that interact with it.This diagram is a high level view of a system. It is similar to a block diagram.

● A data flow diagram (DFD) is a way of representing a flow of a data of a process or a system (usually an information system) The DFD also provides information about the outputs and inputs of each entity and the process itself. A data flow diagram has no control flow, there are no decision rules and no loops. Specific operations based on the data can be represented by a flowchart.

● A data flow diagram (DFD) is a way of representing a flow of a data of a process or a system (usually an information system) The DFD also provides information about the outputs and inputs of each entity and the process itself. A data flow diagram has no control flow, there are no decision rules and no loops. Specific operations based on the data can be represented by a flowchart.

Question 26 |

The following program is to be tested for statement coverage:

begin

if(a==b)

{

S1;

exit;

}

else if (c==d)

{

S2;

}

else

{

S3;

Exit;

}

S4;

end

The test cases T1,T2,T3 and T4 given below are expressed in terms of the properties satisfied by the values of variables a,b,c and d. The exact values are not given

T1:a,b,c and d are all equal

T1:a,b,c and d are all distinct

T3:a=b and c!=d

T4:a!b and c=d

Which of the test suites given below ensures coverage of statements S1,S2,S3 and S4?

begin

if(a==b)

{

S1;

exit;

}

else if (c==d)

{

S2;

}

else

{

S3;

Exit;

}

S4;

end

The test cases T1,T2,T3 and T4 given below are expressed in terms of the properties satisfied by the values of variables a,b,c and d. The exact values are not given

T1:a,b,c and d are all equal

T1:a,b,c and d are all distinct

T3:a=b and c!=d

T4:a!b and c=d

Which of the test suites given below ensures coverage of statements S1,S2,S3 and S4?

T1,T2,T3 | |

T2,T4 | |

T3,T4 | |

T1,T2,T4 |

Question 26 Explanation:

The test cases T1 covers S1 ,T2 covers S3 and T4 covers S2, S4.

Question 27 |

The Function Points(FP) calculated for software projects are often used to obtain an estimate of Lines of code(LOC) required for that project. Which of the following statements is FALSE in this context?

The relationship between FP and LOC depends on the programming language used to implement the software | |

LOC requirement for an assembly language implementation will be more for a given FP value, than LOC for implementation in COBOL. | |

On an average, one LOC of C++ provides approximately 1.6 times the functionality of a single LOC of FORTRAN | |

FP and LOC are not related to each other |

Question 27 Explanation:

● A function point (FP) is a component of software development which helps to approximate the cost of development early in the process.

● A function point calculates software size with the help of logical design and performance of functions as per user requirements.

● “Lines of code” (LOC) is a metric generally used to evaluate a software program or codebase according to its size. It is a general identifier taken by adding up the number of lines of code used to write a program

● A function point calculates software size with the help of logical design and performance of functions as per user requirements.

● “Lines of code” (LOC) is a metric generally used to evaluate a software program or codebase according to its size. It is a general identifier taken by adding up the number of lines of code used to write a program

Question 28 |

The availability of complex software is 90% its Mean Time Between Failure(MTBF) is 200 days. Because of the critical nature of the usage, the organization deploying the software further enhanced it to obtain an availability of 95%. In the process, the Mean Time To Repair(MTTR) increased by 5 days. What is the MTBF of the enhanced software?(choose the nearest option)

205 days | |

300 days | |

500 days | |

700 days |

Question 28 Explanation:

Case-1:Availability of complex software =90% =0.9

Mean Time Between Failure(MTBF)=200

MTTR =?(we need to find )

Case-2:After enhancement modified ,availability= 95%=0.95,For this case,Mean Time To Repair(MTTR) increased by 5 days.

MTBF=?(we need to find )

Availability = MTBF/(MTBF + MTTR)

Case-1:

By substituting option-1 value, 0.9 = 200/(200 + MTTR) then

MTTR= 22.22

Case 2 :0.95 = MTBF/( MTBF+22.22+5)

MTBF= 517.18

Mean Time Between Failure(MTBF)=200

MTTR =?(we need to find )

Case-2:After enhancement modified ,availability= 95%=0.95,For this case,Mean Time To Repair(MTTR) increased by 5 days.

MTBF=?(we need to find )

Availability = MTBF/(MTBF + MTTR)

Case-1:

By substituting option-1 value, 0.9 = 200/(200 + MTTR) then

MTTR= 22.22

Case 2 :0.95 = MTBF/( MTBF+22.22+5)

MTBF= 517.18

Question 29 |

HTML(Hypertext Markup language) has language elements which permit certain actions other than describing the structure of the web document. Which of the following actions is NOT supported by pure HTML(Without any server or client side scripting) pages?

Embed web objects from different sites into the same page | |

Refresh the page automatically after a specified interval | |

Automatically redirect to another page upon download | |

Display the client time as part of the page |

Question 29 Explanation:

We can achieve first three options by using HTML(static web pages). But to display the client time alone HTML is not sufficient , We require Java Script.

Question 30 |

Consider the HTML table definition given below":

The number of rows in each column and the number of columns in each row are:

The number of rows in each column and the number of columns in each row are:

(2,2,3) and (2,3,2) | |

(2,2,3) and (2,2,3) | |

(2,3,2) and (2,3,2) | |

(2,3,2) and (2,2,3) |

Question 30 Explanation:

If you create HTML page with the above code,we will get table structure as below

Question 31 |

Which of the following statements is/are False?

1. XML overcomes the limitations in HTML to support a structured way of organizing content

2. XML specification is not case sensitive while HTML specification is case sensitive

3. XML supports user defined tags while HTML uses pre-defined tags.

4. XML tags need not be closed while HTML tags must be closed

1. XML overcomes the limitations in HTML to support a structured way of organizing content

2. XML specification is not case sensitive while HTML specification is case sensitive

3. XML supports user defined tags while HTML uses pre-defined tags.

4. XML tags need not be closed while HTML tags must be closed

2 only | |

1 only | |

2 and 4 only | |

3 and 4 only |

Question 31 Explanation:

● Both XML and HTML languages are case sensitive.

● Both XML and HTML consists of Tags. Every open tag should consists of close tag in both languages.

● Both XML and HTML consists of Tags. Every open tag should consists of close tag in both languages.

Question 32 |

Output of following program

#include

int main()

{

int i=5;

printf("%d%d%d", i++,i++,i++);

return 0;

}

#include

int main()

{

int i=5;

printf("%d%d%d", i++,i++,i++);

return 0;

}

765 | |

567 | |

777 | |

compile dependent |

Question 32 Explanation:

● Multiple increment or decrement of same variable in one expression or one statement is compiler dependent.

● The output will depend upon the way the compiler developed.

● The output will depend upon the way the compiler developed.

Question 33 |

Output of following program?

#include

void dynamic(int s,..)

{

printf("%d",s);

}

int main()

{

dynamic(2,4,6,8);

dynamic(3,6,9);

return 0;

}

#include

void dynamic(int s,..)

{

printf("%d",s);

}

int main()

{

dynamic(2,4,6,8);

dynamic(3,6,9);

return 0;

}

23 | |

compile error | |

43 | |

32 |

Question 33 Explanation:

● The latest compiler giving compilation error “error: expected declaration specifiers or ‘...’ before ‘.’ toke n“

● Old compiler may support that syntax, in that syntax only first argument is defined which consists of remainings arguments but not defined.

● For the function call dynamic(2,4,6,8), first argument 2 is printed.

● For the function call dynamic(3,6,9);first argument 3 is printed.

● Old compiler may support that syntax, in that syntax only first argument is defined which consists of remainings arguments but not defined.

● For the function call dynamic(2,4,6,8), first argument 2 is printed.

● For the function call dynamic(3,6,9);first argument 3 is printed.

Question 34 |

Output of following program?

#include

int main()

{

int *ptr;

int x;

ptr=&x;

*ptr=0;

printf("x=%d\n",x);

printf("*ptr=%d\n",*ptr);

*ptr+=5;

printf("x=%d\n",x);

printf("*ptr=%d\n",*ptr);

(*ptr)++;

printf(x=%d\n",x);

printf("*ptr=%d\n",*ptr);

return 0;

}

#include

int main()

{

int *ptr;

int x;

ptr=&x;

*ptr=0;

printf("x=%d\n",x);

printf("*ptr=%d\n",*ptr);

*ptr+=5;

printf("x=%d\n",x);

printf("*ptr=%d\n",*ptr);

(*ptr)++;

printf(x=%d\n",x);

printf("*ptr=%d\n",*ptr);

return 0;

}

x=0 *ptr=0 x=5 *ptr=5 x=6 *ptr=6 | |

x=garbage value *ptr=0 x=garbage value *ptr=5 x=garbage value *ptr=6 | |

x=0 *ptr=0 x=5 *ptr=5 x=garbage value *ptr=garbage value | |

x=0 *ptr=0 x=0 *ptr=0 x=0 *ptr=0 |

Question 34 Explanation:

● ptr=&x; // Address of x variable will store in to pointer “ptr” or pointer “ptr” will point to “x”

● *ptr=0; // storing value “0” in the memory location.

● printf("x=%d\n",x); // “0” will be printed

● printf("*ptr=%d\n",*ptr); // “0” will be printed because , ptr will point to variable “x”

● *ptr+=5; // *ptr+=5; means *ptr=*ptr+5 which is nothing but value 5 will store into memory locaton

● printf("x=%d\n",x); // 5 will be printed

● printf("*ptr=%d\n",*ptr); //5 will be printed.

● (*ptr)++; // (*ptr) means 5 and it is incremented by 1 so the updated value is “6”

● printf(x=%d\n",x); // “6” will be printed

● printf("*ptr=%d\n",*ptr);// “6” will be printed

● *ptr=0; // storing value “0” in the memory location.

● printf("x=%d\n",x); // “0” will be printed

● printf("*ptr=%d\n",*ptr); // “0” will be printed because , ptr will point to variable “x”

● *ptr+=5; // *ptr+=5; means *ptr=*ptr+5 which is nothing but value 5 will store into memory locaton

● printf("x=%d\n",x); // 5 will be printed

● printf("*ptr=%d\n",*ptr); //5 will be printed.

● (*ptr)++; // (*ptr) means 5 and it is incremented by 1 so the updated value is “6”

● printf(x=%d\n",x); // “6” will be printed

● printf("*ptr=%d\n",*ptr);// “6” will be printed

Question 35 |

Assume that float takes 4 bytes, predict the output of following program.

#include

int main()

{

float arr[5]={12.5,10.0,13.5,90.5,0.5};

float *ptr1=&arr[0];

float *ptr2=ptr1+3;

printf("%f",*ptr2);

printf("%d",ptr2-ptr1);

return 0;

}

#include

int main()

{

float arr[5]={12.5,10.0,13.5,90.5,0.5};

float *ptr1=&arr[0];

float *ptr2=ptr1+3;

printf("%f",*ptr2);

printf("%d",ptr2-ptr1);

return 0;

}

90.500000 3 | |

90.500000 12 | |

10.000000 12 | |

0.500000 3 |

Question 35 Explanation:

● float *ptr1=&arr[0]; // ptr1 will point to first element of the array.

● float *ptr2=ptr1+3; // ptr2 will point to fourth element of the array

● printf("%f",*ptr2); // It will display fourth element value which is 90.500000

● printf("%d",ptr2-ptr1); // Here both pointer will point to same array . The subtraction operation gives the number of elements between the addresses.

● float *ptr2=ptr1+3; // ptr2 will point to fourth element of the array

● printf("%f",*ptr2); // It will display fourth element value which is 90.500000

● printf("%d",ptr2-ptr1); // Here both pointer will point to same array . The subtraction operation gives the number of elements between the addresses.

Question 36 |

Assume that size of an integer is 32 bit. What is the output of following ANSI C program?

#include

struct st

{

int x;

static int y;

};

int main()

{

printf(%d",sizeof(struct st));

return 0;

}

#include

struct st

{

int x;

static int y;

};

int main()

{

printf(%d",sizeof(struct st));

return 0;

}

4 | |

8 | |

compile error | |

runtime error |

Question 36 Explanation:

● It will be compile error- “error: expected specifier-qualifier-list before ‘static’ static int y;”

● Static variables are allocated memory in data segment, not stack segment.

● Static variable isn't allowed in struct because C requires the whole structure elements to be placed "together". To withdraw a element value from a structure is counted by the offset of the element from the beginning address of the structure.

● Static variables are allocated memory in data segment, not stack segment.

● Static variable isn't allowed in struct because C requires the whole structure elements to be placed "together". To withdraw a element value from a structure is counted by the offset of the element from the beginning address of the structure.

Question 37 |

Consider the following C declaration

Struct

{

short s[5];

Union

{

float y;

long z;

}u;

}t;

Assume that objects of the type short, float and long occupy 2 bytes, 4 bytes and 8 bytes respectively. The memory requirement for variable t ignoring alignment considerations, is

Struct

{

short s[5];

Union

{

float y;

long z;

}u;

}t;

Assume that objects of the type short, float and long occupy 2 bytes, 4 bytes and 8 bytes respectively. The memory requirement for variable t ignoring alignment considerations, is

22 bytes | |

14 bytes | |

18 bytes | |

10 bytes |

Question 37 Explanation:

Union

{

float y;

long z;

}u;

● The sizeof union is 8 bytes (maximum size of two variables sizes 4 and 8)

● The size of structure is sum of short size(array of 5 elements) is 5x2=10 and union size is 8.

● So the total size is 18.

{

float y;

long z;

}u;

● The sizeof union is 8 bytes (maximum size of two variables sizes 4 and 8)

● The size of structure is sum of short size(array of 5 elements) is 5x2=10 and union size is 8.

● So the total size is 18.

Question 38 |

#include

struct st

{

int x;

struct st next;

};

int main()

{

struct st temp;

temp.x=10;

temp.next=temp;

printf("%d",temp.next,x);

return 0;

}

struct st

{

int x;

struct st next;

};

int main()

{

struct st temp;

temp.x=10;

temp.next=temp;

printf("%d",temp.next,x);

return 0;

}

Compile error | |

10 | |

Runtime Error | |

Garbage value |

Question 38 Explanation:

● We can’t declare structure member of own type with in the structure.

● But we can declare pointer structure member with in same structure which is called self referential structure.

● The above code gives compile error “ main.c:5:11: error: field ‘next’ has incomplete type struct st next”

● But we can declare pointer structure member with in same structure which is called self referential structure.

● The above code gives compile error “ main.c:5:11: error: field ‘next’ has incomplete type struct st next”

Question 39 |

Give the output

#include

using namespace std;

class Base

{

Public:

int x,y;

Public:

Base(int i, int j)

{

x=i;y=j;

}

};

class Derived:public Base

{

public:

Derived(int i,int j):x(i),y(j){}

void print()

{

cout<
};

int main(void)

{

Derived q(10,10);

q.print();

return 0;

}

#include

using namespace std;

class Base

{

Public:

int x,y;

Public:

Base(int i, int j)

{

x=i;y=j;

}

};

class Derived:public Base

{

public:

Derived(int i,int j):x(i),y(j){}

void print()

{

cout<

int main(void)

{

Derived q(10,10);

q.print();

return 0;

}

1010 | |

compile error | |

00 | |

None of the option |

Question 39 Explanation:

We can’t directly assign the base class members by using initializer list in the derived class

We should call the base class constructor in order to initialize base class members.

We should call the base class constructor in order to initialize base class members.

Question 40 |

Give the output

#include

using namespace

class Base1

{

public:

~Base1()

{

cout<<"Base1's destructor"<
};

class Base2

{

public:

~Base1()

{

cout<<"Base2's destructor"<
};

class Derived : public Base1,public Base2

{

public:

~Derived()

{

cout<<"Derived's destructor"<
}

int main()

{

Derived d;

return 0;

}

#include

using namespace

class Base1

{

public:

~Base1()

{

cout<<"Base1's destructor"<

class Base2

{

public:

~Base1()

{

cout<<"Base2's destructor"<

class Derived : public Base1,public Base2

{

public:

~Derived()

{

cout<<"Derived's destructor"<

int main()

{

Derived d;

return 0;

}

Base1'1 destructor Base2'2 destructor Derived Destructor | |

Derived Destructor Base2'2 destructor Base1'1 destructor | |

Derived Destructor | |

Compiler Dependent |

Question 40 Explanation:

● C++ constructor call order will be from top to down that is from base class to derived class and c++ destructor call order will be in reverse order.

● First child class and later parent class.

● First child class and later parent class.

Question 41 |

Which of the following is/are true about packages in Java?

1) Every class is part of some package

2) All classes in a file are part of the same package

3)If no package is specified, the classes in the file go into a special unnamed package.

4) If no package is specified, a new package is created with folder name of class and the class is put in this package

1) Every class is part of some package

2) All classes in a file are part of the same package

3)If no package is specified, the classes in the file go into a special unnamed package.

4) If no package is specified, a new package is created with folder name of class and the class is put in this package

Only 1,2 and 3 | |

Only 1,2 and 4 | |

Only 4 | |

Only 1 and 3 |

Question 41 Explanation:

Option -4 false because new package is created by using syntax package package_name which is user defined .There is no relation with class name.

Question 42 |

Which of the following is false about abstract classes in java?

If we derive an abstract class and do not implement all the abstract methods, then the derived class should also be marked as abstract using 'abstract' keyword | |

Abstract classes can have constructors. | |

A class can be made abstract without any abstract method | |

A class can inherit from multiple abstract classes |

Question 42 Explanation:

● An abstract class can have an abstract method without body and it can have methods with implementation also.
● Multiple inheritance is not possible with abstract classes.

Question 43 |

Which of the following is true about interfaces in java?

1. An interface can contain following type of members.

...public,static,final fields(i.e., constants)

...default and static methods with bodies

2. An instance of interface can be created.

3. A class can implement multiple interfaces

4. many classes can implement the same interface

1. An interface can contain following type of members.

...public,static,final fields(i.e., constants)

...default and static methods with bodies

2. An instance of interface can be created.

3. A class can implement multiple interfaces

4. many classes can implement the same interface

1,3 and 4 | |

1,2 and 4 | |

2,3 and 4 | |

1,2,3 and 4 |

Question 43 Explanation:

● The interface in java is a blueprint of a class. It has static constants and abstract methods.

● There can be only abstract methods in the Java interface, not method body.

● It cannot be instantiated just like the abstract class because there is no method definition available with the interface.

● There can be only abstract methods in the Java interface, not method body.

● It cannot be instantiated just like the abstract class because there is no method definition available with the interface.

Question 44 |

Consider three processes(process id 0,1,2 respectively) with compute time bursts 2,4 and 8 time units. All processes arrive at time zero. Consider the Longest remaining time first(LRTF) scheduling algorithm. In LRTF ties are broken by giving priority to the process with the lowest process id. The average turnaround time is:

13 units | |

14 units | |

15 units | |

16 units |

Question 44 Explanation:

Algorithm: LRTF (Longest Remaining Time First)

Avg TAT = 12+13+14/3 = 39/3 = 13 units

Avg TAT = 12+13+14/3 = 39/3 = 13 units

Question 45 |

Consider three processes, all arriving at time zero, with total execution time of 10,20 and 30 units, respectively. Each process spends the first 20% of execution time doing I/O, the next 70% of time doing computations, and the last 10% of time doing I/O again. The operating system uses a shortest remaining compute time first scheduling algorithm and schedules a new process either when the running process gets blocked on I/O or when the running process finishes its compute burst. Assume that all I/O operations can be overlapped as much as possible. For what percentage f time does the CPU remain idle?

0% | |

10.6% | |

30.0% | |

89.4% |

Question 45 Explanation:

Total time needed to complete the execution = 47

Idle time = 2+3 = 5

Percentage of Idle time = 5/47 × 100 =10.6%

Question 46 |

Consider three CPU-intensive processes which require 10,20 and 30 time units and arrive at times 0,2 and 6, respectively. How arrive at times 0,2 and 6, respectively. How many context switches are needed if the operating system implements a shortest remaining time first scheduling algorithm? Do not count the context switches at time zero and at the end.

1 | |

2 | |

3 | |

4 |

Question 46 Explanation:

Total no.of context switches is 2.

Question 47 |

Which of the following process scheduling algorithm may lead to starvation?

FIFO | |

Round Robin | |

Shortest Job Next | |

None of the option |

Question 47 Explanation:

● Starvation is method in which process with high priorities continuously uses the resources preventing low priority process to acquire the resources

● In the Shortest job next scheduling shortest job process will run first and later higher burst time.Here the process with higher burst time need to wait for longer time.

● In the Shortest job next scheduling shortest job process will run first and later higher burst time.Here the process with higher burst time need to wait for longer time.

Question 48 |

A scheduling algorithm assigns priority proportional to the waiting time of a process. Every process starts with priority zero(the lowest priority). The scheduler
re-evaluates the process priorities every T time units and decides the next process to schedule. Which one of the following is TRUE if the processes have no I/O operations and all arrive at time zero?

This algorithm is equivalent to the first come first serve algorithm | |

This algorithm is equivalent to the round-robin algorithm | |

This algorithm is equivalent t the shortest-job-first algorithm | |

This algorithm is equivalent to the shortest-remaining time-first algorithm |

Question 48 Explanation:

Let's take an example:

Consider scheduler schedule processes priority after S times units so order of execution will be P1 P2 P3 P4 P1 P2 P3 P4 (S< execution time of any process) which is exactly same as round robin so answer – B.

Consider scheduler schedule processes priority after S times units so order of execution will be P1 P2 P3 P4 P1 P2 P3 P4 (S< execution time of any process) which is exactly same as round robin so answer – B.

Question 49 |

Which one of the following is true?

NAND gate and AND gate both are universal gates | |

NOR gate and OR gate both are universal gates | |

NAND gate and OR gate both are universal gates | |

NAND gate and NOR gate both are universal gates |

Question 49 Explanation:

A universal gate is a gate which can implement any Boolean function without need to use any other gate type. The NAND and NOR gates are universal gates.

Question 50 |

Which one of the following is the function of a multiplexer

To decode information | |

To select 1 out of N input data sources and to transmit it to single channel | |

To transmit data on N lines | |

To perform serial to parallel conversion |

Question 50 Explanation:

● A multiplexer (or mux) is a device that combines several analog or digital input signals and forwards them into a single output line.

● A multiplexer of 2 n inputs has n select lines, which are used to select which input line to send to the output.

● Multiplexers are mainly used to increase the amount of data that can be sent over the network within a certain amount of time and bandwidth.

● A multiplexer of 2 n inputs has n select lines, which are used to select which input line to send to the output.

● Multiplexers are mainly used to increase the amount of data that can be sent over the network within a certain amount of time and bandwidth.

Question 51 |

0/1-Knapsack is a well known problem where, it is desired to get the maximum total profit by placing n items(each item is having some weight and associated profit) into a knapsack of capacity W. The table given below shows the weights and associated profits for 5 items, where one unit of each item is available to you. It is also given that the knapsack capacity W is 8. If the given 0/1 knapsack problem is solved using Dynamic Programming, which one of the following will be maximum earned profit by placing the items into the knapsack of capacity 8.

19 | |

18 | |

17 | |

20 |

Question 51 Explanation:

Here, we can get the first item using profit per weight even we are using 0/1 knapsack.

→ According to above Profit/weight ratio, the item-1 having maximum profit. So, pick item-1.

→ Now M=7, Pick item-2 because it has more profit.

→ Now M=5, Now according to profit/weight ration we can pick item-3 or item-5 but item-5 having more weight, so it exceeds capacity. If we are selecting item-3 means we are wasting 1 slot. So, here, profit/weight ration fails. So, follow brute force technique in this position. We can pick item-4 because it has weight 5.

→ Now, M=0 and Profit=19. [item1 + item2 + item4]

→ According to above Profit/weight ratio, the item-1 having maximum profit. So, pick item-1.

→ Now M=7, Pick item-2 because it has more profit.

→ Now M=5, Now according to profit/weight ration we can pick item-3 or item-5 but item-5 having more weight, so it exceeds capacity. If we are selecting item-3 means we are wasting 1 slot. So, here, profit/weight ration fails. So, follow brute force technique in this position. We can pick item-4 because it has weight 5.

→ Now, M=0 and Profit=19. [item1 + item2 + item4]

Question 52 |

'AS' clause is used in SQL for

Selection operation | |

rename operation | |

Join Operation | |

Projection Operation |

Question 52 Explanation:

● AS is a keyword in SQL that allows you to rename a column or table using an alias.

● Syntax: SELECT column_name AS 'Alias' FROM table_name;

● Syntax: SELECT column_name AS 'Alias' FROM table_name;

Question 53 |

Related fields in a database are grouped to form a

data file | |

data record | |

menu | |

Bank |

Question 53 Explanation:

● In a database, a record (sometimes called a row) is a group of fields within a table that are relevant to a specific entity.

● For example, in a table called customer contact information, a row would likely contain fields such as: ID number, name, street address, city, telephone number and so on.

● For example, in a table called customer contact information, a row would likely contain fields such as: ID number, name, street address, city, telephone number and so on.

Question 54 |

cross product is a

Unary operator | |

ternary operator | |

binary Operator | |

Not an operator |

Question 54 Explanation:

● The cross product of two tables A x B builds a huge virtual table by pairing every row of A with every row of B.

● This operator requires two tables so it binary operator.

● This operator requires two tables so it binary operator.

Question 55 |

A table joined with itself is called

join | |

self join | |

outer join | |

Equi join |

Question 55 Explanation:

● A self join is a join in which a table is joined with itself (which is also called Unary relationships), especially when the table has a FOREIGN KEY which references its own PRIMARY KEY.

● To join a table itself means that each row of the table is combined with itself and with every other row of the table.

● To join a table itself means that each row of the table is combined with itself and with every other row of the table.

Question 56 |

Consider the join of a relation R with relation S. If R has m tuples and S has n tuples, then the maximum size of join is

mn | |

m+n | |

(m+n)/2 | |

2(m+n) |

Question 56 Explanation:

For maximum:

If there is common attribute in R and S, and every row of R match with every row of S then total no. of tuples will be mn.

If there is common attribute in R and S, and every row of R match with every row of S then total no. of tuples will be mn.

Question 57 |

Let L be a lattice. Then for every a and b in L which one of the following is correct?

aVb = a ⋀ b | |

aV(bVc)=(aVb)Vc | |

aV(b ⋀ c)=a | |

aV(bVc)=b |

Question 57 Explanation:

Distributive lattice is satisfies this condition aV(bVc)=(aVb)Vc

A distributive lattice is a lattice in which the operations of join and meet distribute over each other.

A distributive lattice is a lattice in which the operations of join and meet distribute over each other.

Question 58 |

Let N={1,2,3,...} be ordered by divisibility, which of the following subset is totally ordered?

(2,6,24) | |

(3,5,15) | |

(2,9,16) | |

(4,15,30) |

Question 58 Explanation:

A binary relation R on a set A is a total order on A iff R is a connected partial order on A.

Question 59 |

In digital logic, if A ⊕ B=C, then which one of the following is true?

A ⊕ C=B | |

B ⊕ C=A | |

A ⊕ B ⊕ C=0 | |

Both A) and B) | |

None of these |

Question 59 Explanation:

Given that

XOR:

X ⊕ X= 0

X ⊕ X'= 1

X ⊕ 0 = X

X ⊕ 1 = X'

A) A ⊕ C = B

A ⊕ A ⊕ B = B

0 ⊕ B = B

B= B

B) B ⊕C = A

B ⊕ A ⊕ B = A

A ⊕ 0=A

A=A

C) A⊕B=C

A⊕B⊕ C=C ⊕C ,

A⊕B⊕ C= 0

All are correct

XOR:

X ⊕ X= 0

X ⊕ X'= 1

X ⊕ 0 = X

X ⊕ 1 = X'

A) A ⊕ C = B

A ⊕ A ⊕ B = B

0 ⊕ B = B

B= B

B) B ⊕C = A

B ⊕ A ⊕ B = A

A ⊕ 0=A

A=A

C) A⊕B=C

A⊕B⊕ C=C ⊕C ,

A⊕B⊕ C= 0

All are correct

Question 60 |

What is the running time of the following function(specified as a function of the input value)?

void Function(int n)

{

int i=1;

int s=1;

while(s<=n)

{

i++;

s=s+i;

}

}

void Function(int n)

{

int i=1;

int s=1;

while(s<=n)

{

i++;

s=s+i;

}

}

O(n) | |

O(n ^{ 2} ) | |

O(1) | |

O(√n) |

Question 60 Explanation:

S= 1, 3, 6, 10, 15 21….(>n) stopping condition.

i= 1, 2, 3, 4, 5, 6…..

Here, ‘S’ is nothing but sum of ‘n’ natural numbers

Assume the n=21, then corresponding k value 6. "k^2" is nothing but 36 which is greater than "n"

For any given K value , the S value is k(k+1)/2, So, 6(6+1)/2=21

the loop will terminate whenever k(k+1)/2 >n

k=O(√n)

i= 1, 2, 3, 4, 5, 6…..

Here, ‘S’ is nothing but sum of ‘n’ natural numbers

Assume the n=21, then corresponding k value 6. "k^2" is nothing but 36 which is greater than "n"

For any given K value , the S value is k(k+1)/2, So, 6(6+1)/2=21

the loop will terminate whenever k(k+1)/2 >n

k=O(√n)

There are 60 questions to complete.