## 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
 A E B 2E C V D 2V
Engineering-Mathematics       Graph-Theory
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?
 A In adjacency list representation, space is saved for sparse graphs. B Deleting a vertex in adjacency list representation is easier than adjacency matrix representation C Adding a vertex in adjacency list representation is easier than adjacency matrix representation. D All of the option
Data-Structures       Graphs
Question 2 Explanation:
● 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​ )
● 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?
 A Euler circuit B Hamiltonian path C Euler Path D Hamiltonian Circuit
Engineering-Mathematics       Graph-Theory
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.
 Question 4
what are the appropriate data structures for graph traversal using Breadth First Search(BFS) and Depth First Search(DFS) algorithms?
 A Stack for BFS and Queue for DFS B Queue for BFS and Stack for DFS C Stack for BFS and Stack for DFS D Queue for BFS and Queue for DFS
Data-Structures       Graphs
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.
 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?
 A I,II and IV only B I and IV only C II,III and IV only D I,III and IV only
Data-Structures       Graphs
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.
 Question 6
Considering the following graph, which one of the following set of edged represents all the bridges of the given graph? A (a,b)(e,f) B (a,b),(a,c) C (c,d)(d,h) D (a,b)
Engineering-Mathematics       Graph-Theory
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.
 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.
 A S1 is true B S2 is true C S1 and S2 both are true D S1 and S2 both are false
Engineering-Mathematics       Graph-Theory
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.
 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:
 A 5 B 6 C 7 D 8
Engineering-Mathematics       Graph-Theory
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
 Question 9
Power set of empty set has exactly__subset
 A One B Two C Zero D Three
Engineering-Mathematics       Set-Theory
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 "∅".
 Question 10
What is the cartesian product of A={1,2} and B={a,b}?
 A {(1,a),(1,b),(2,a),(b,b)} B {(1,1),(2,2),(a,a),(b,b)} C {(1,a),(2,a),(1,b),(2,b)} D {(1,1),(a,a),(2,a),(1,b)}
Engineering-Mathematics       Set-Theory
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.
 Question 11
What is the cardinality of the power set of the set {0,1,2}?
 A 8 B 6 C 7 D 9
Engineering-Mathematics       Set-Theory
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
 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
 A 6 B 8 C 9 D 13
Engineering-Mathematics       Graph-Theory
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
 Question 13
Which of the following statements is false?
 A (P⋀Q)V(~P⋀Q)V(P⋀~Q) is equal to ~Q⋀~P B (P⋀Q)V(~P⋀Q)V(P⋀~Q) is equal to QVP C (P⋀Q)V(~P⋀Q)V(P⋀~Q) is equal to QV(P⋀~q) D (P⋀Q)V(~P⋀Q)V(P⋀~Q) is equal to PV(Q⋀~p)
Engineering-Mathematics       Propositional-Logic
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.
 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
 A 12 B 7 C 144 D 264
Engineering-Mathematics       Combinatorics
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.
 Question 15
The number of diagonals that can be drawn by joining the vertices of an octagon is
 A 28 B 48 C 20 D None of the option
Engineering-Mathematics       Graph-Theory
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.
 Question 16
A partial ordered relation is transitive, reflexive and
 A Antisymmetric B bisymmetric C anti reflexive D Asymmetric
Engineering-Mathematics       Set-Theory
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.
 Question 17
In tuple relational calculus P1 → p2 is equivalent to
 A ~P1 V P2 B P1 V p2 C P1 ⋀ P2 D P1 ⋀ ~P2
Database-Management-System       Relational-Calculus
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?
 A B is a finite but not complemented lattice B B is a finite, Complemented and distributive lattice C B is a finite,distributive but not complemented lattice D B is not distributive lattice
Engineering-Mathematics       Set-Theory
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:  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?
 A |R|<=|dom(A1)X dom(A2)..dom(An)| B |R|>=|dom(A1)X dom(A2)..dom(An)| C |R|=max(|dom(A1)|,|dom(A2)|,..|dom(An)|) D |R|=min(|dom(A1)|,|dom(A2)|,..|dom(An)|)
Database-Management-System       Relational-Algebra
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.
 Question 20
If A and B are two sets and A U B = A ​ ∩ ​ B then
 A A=​ ∅ B B=​ ∅ C A != B D A=B
Engineering-Mathematics       Set-Theory
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
 Question 21
The relation {(1,2),(1,3)(3,1),(1,1),(3,3),(3,2),(1,4),(4,2),(3,4)} is
 A Reflexive B Transitive C Symmetric D Asymmetric
Engineering-Mathematics       Set-Theory
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.
 Question 22
If an SQl query involves NOT,AND,OR with no parenthesis
 A NOT will be evaluated first; AND will be evaluated second;OR will be evaluated last B NOT will be evaluated first; OR will be evaluated second;AND will be evaluated last C AND will be evaluated first; OR will be evaluated second;NOT will be evaluated last D The order of occurrence determines the order of evaluation
Database-Management-System       SQL
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:
 A 4/52 X 4/52 B 4/52 X 3/52 C 4/52 X 3/51 D 4/52 X 4/51
Engineering-Mathematics       Probability
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
 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:
 A I-II-III-IV-V B V-IV-III-II-I C I-III-V-II-IV D IV-II-V-III-I
Software-Engineering       Coupling-and-Cohesion
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
 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.
 A II and IV B II and III C I and III D I,II and III
Software-Engineering       DFD
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.
 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?
 A T1,T2,T3 B T2,T4 C T3,T4 D T1,T2,T4
Software-Engineering       Software-testing
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?
 A The relationship between FP and LOC depends on the programming language used to implement the software B LOC requirement for an assembly language implementation will be more for a given FP value, than LOC for implementation in COBOL. C On an average, one LOC of C++ provides approximately 1.6 times the functionality of a single LOC of FORTRAN D FP and LOC are not related to each other
Software-Engineering       Functional-Points
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
 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)
 A 205 days B 300 days C 500 days D 700 days
Software-Engineering       Software-quality
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
 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?
 A Embed web objects from different sites into the same page B Refresh the page automatically after a specified interval C Automatically redirect to another page upon download D Display the client time as part of the page
Web-Technologies       HTML
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:
 A (2,2,3) and (2,3,2) B (2,2,3) and (2,2,3) C (2,3,2) and (2,3,2) D (2,3,2) and (2,2,3)
Web-Technologies       HTML
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
 A 2 only B 1 only C 2 and 4 only D 3 and 4 only
Web-Technologies       HTML
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.
 Question 32
Output of following program
#include
int main()
{
int i=5;
printf("%d%d%d", i++,i++,i++);
return 0;
}
 A 765 B 567 C 777 D compile dependent
Programming       Control Flow
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.
 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;
}
 A 23 B compile error C 43 D 32
Programming       Functions
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.
 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;
}
 A x=0 *ptr=0 x=5 *ptr=5 x=6 *ptr=6 B x=garbage value *ptr=0 x=garbage value *ptr=5 x=garbage value *ptr=6 C x=0 *ptr=0 x=5 *ptr=5 x=garbage value *ptr=garbage value D x=0 *ptr=0 x=0 *ptr=0 x=0 *ptr=0
Programming       Pointers
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
 Question 35
Assume that float takes 4 bytes, predict the output of following program.
#include
int main()
{
float arr={12.5,10.0,13.5,90.5,0.5};
float *ptr1=&arr;
float *ptr2=ptr1+3;
printf("%f",*ptr2);
printf("%d",ptr2-ptr1);
return 0;
}
 A 90.500000 3 B 90.500000 12 C 10.000000 12 D 0.500000 3
Programming       Pointers
Question 35 Explanation:
● float *ptr1=&arr; // 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.
 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;
}
 A 4 B 8 C compile error D runtime error
Programming       Structure
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.
 Question 37
Consider the following C declaration
Struct
{
short s;
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
 A 22 bytes B 14 bytes C 18 bytes D 10 bytes
Programming       Structure
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.
 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;
}
 A Compile error B 10 C Runtime Error D Garbage value
Programming       Structure
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”
 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;
}
 A 1010 B compile error C 00 D None of the option
OOPS       Properties
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.
 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;
}
 A Base1'1 destructor Base2'2 destructor Derived Destructor B Derived Destructor Base2'2 destructor Base1'1 destructor C Derived Destructor D Compiler Dependent
OOPS       Destructors
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.
 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
 A Only 1,2 and 3 B Only 1,2 and 4 C Only 4 D Only 1 and 3
OOPS       Class
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?
 A 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 B Abstract classes can have constructors. C A class can be made abstract without any abstract method D A class can inherit from multiple abstract classes
OOPS       Class
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
 A 1,3 and 4 B 1,2 and 4 C 2,3 and 4 D 1,2,3 and 4
OOPS       Class
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.
 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:
 A 13 units B 14 units C 15 units D 16 units
Operating-Systems       Process-Scheduling
Question 44 Explanation:
Algorithm: LRTF (Longest Remaining Time First) 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?
 A 0% B 10.6% C 30.0% D 89.4%
Operating-Systems       Process-Scheduling
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.
 A 1 B 2 C 3 D 4
Operating-Systems       Process-Scheduling
Question 46 Explanation: Total no.of context switches is 2.
 Question 47
Which of the following process scheduling algorithm may lead to starvation?
 A FIFO B Round Robin C Shortest Job Next D None of the option
Operating-Systems       Process-Scheduling
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.
 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?
 A This algorithm is equivalent to the first come first serve algorithm B This algorithm is equivalent to the round-robin algorithm C This algorithm is equivalent t the shortest-job-first algorithm D This algorithm is equivalent to the shortest-remaining time-first algorithm
Operating-Systems       Process-Scheduling
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.
 Question 49
Which one of the following is true?
 A NAND gate and AND gate both are universal gates B NOR gate and OR gate both are universal gates C NAND gate and OR gate both are universal gates D NAND gate and NOR gate both are universal gates
Digital-Logic-Design       Logic-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
 A To decode information B To select 1 out of N input data sources and to transmit it to single channel C To transmit data on N lines D To perform serial to parallel conversion
Digital-Logic-Design       Combinational-Circuits
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.
 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. A 19 B 18 C 17 D 20
Algorithms       0/1-Knapsack-and-fractional-knapsack
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]
 Question 52
'AS' clause is used in SQL for
 A Selection operation B rename operation C Join Operation D Projection Operation
Database-Management-System       SQL
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;
 Question 53
Related fields in a database are grouped to form a
 A data file B data record C menu D Bank
Database-Management-System       Relational-databases
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.
 Question 54
cross product is a
 A Unary operator B ternary operator C binary Operator D Not an operator
Programming       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.
 Question 55
A table joined with itself is called
 A join B self join C outer join D Equi join
Database-Management-System       Relational-Algebra
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.
 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
 A mn B m+n C (m+n)/2 D 2(m+n)
Database-Management-System       Relational-Algebra
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.
 Question 57
Let L be a lattice. Then for every a and b in L which one of the following is correct?
 A aVb = a​ ⋀ ​ b B aV(bVc)=(aVb)Vc C aV(b​ ⋀ ​ c)=a D aV(bVc)=b
Engineering-Mathematics       Set-Theory
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.
 Question 58
​ Let N={1,2,3,...} be ordered by divisibility, which of the following subset is totally ordered?
 A (2,6,24) B (3,5,15) C (2,9,16) D (4,15,30)
Engineering-Mathematics       Set-Theory
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 A ​ ⊕ ​ C=B B B ​ ⊕ ​ C=A C A ​ ⊕ ​ B ​ ⊕ ​ C=0 D Both A) and B) E None of these
Digital-Logic-Design       Boolean-Algebra
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
 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;
}
}
 A O(n) B O(n​ 2​ ) C O(1) D O(​√n)
Algorithms       Asymptotic-Complexity
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)
There are 60 questions to complete.