A bag contains 3 white, 5 blue and 4 green balls. If two balls are drawn at random from the bag, then find the probability that both the balls are of same colour?
A :
19/66
B :
18/66
C :
12/66
D :
17/66
Answer: A
Q. No. :
2
Question :
The odds in favour of a player being selected for the national team with three independent selectors are 4:3, 2:1 and 1:4 respectively. What is the probability that of the three selectors a majority will be favourable?
A :
2/5
B :
10/21
C :
6/35
D :
2/21
Answer: B
Q. No. :
3
Question :
If Ashok travelled at 4/5 th of his usual speed, he would reach his destination 15 minutes late. By how much minutes would he be early if he travelled at 6/5 th of his usual speed?
A :
12
B :
10
C :
15
D :
16
Answer: B
Q. No. :
4
Question :
There are 30 mango trees, 40 guava trees and 50 apple trees. The trees are planted in such a way that each row of trees contains trees of the same variety and every row contains an equal number of trees. Find the minimum number of rows in which all the trees could be planted.
A :
9
B :
10
C :
11
D :
12
Answer: D
Q. No. :
5
Question :
In a right angled triangle, the larger of the sides containing the right angle is 8cm longer than the smaller of the sides. The sum of the lengths of the sides containing the right angle is 16cm more than the length of the other side. Find the length (in cm) of the smallest side.
A :
18
B :
12
C :
24
D :
16
Answer: C
Q. No. :
6
Question :
A test had 200 question. each correct answer carries 2 marks. each wrong answer carried (-1/2) marks and unanswered question carried no mark. Ajay attempted all the question in the test and scored 360 marks. What would his marks be, if for each correct answer he got only 1/2 mark and for each wrong answer he lost 2 marks?
A :
80
B :
100
C :
60
D :
120
Answer: C
Q. No. :
7
Question :
Two men or 5 women can complete a piece of work in 15 days. In how many days can 4 men and 5 women complete the same work?
If you put a finally block after a try and its associated catch
blocks, then once execution enters the try block, the code in that
finally block will definitely be executed except in the following
circumstances:
An exception arising in the finally block itself.
The death of the thread.
The use of System.exit()
Turning off the power to the CPU.
I suppose the last three could be classified as VM shutdown.
Q. No. :
9
Question :
publicclassMyRunnableimplementsRunnable
{publicvoid run()
{
// some code here
}
}
Because the class implements Runnable, an instance of it has to be passed to the Thread constructor, and then the instance of the Thread has to be started.
A is incorrect. There is no constructor like this for Runnable because Runnable is an interface, and it is illegal to pass a class or interface name to any constructor.
B is incorrect for the same reason; you can't pass a class or interface name to any constructor.
D is incorrect because MyRunnable doesn't have a start() method, and the only start() method that can start a thread of execution is the start() in the Thread class.
Q. No. :
10
Question :
You need to store elements in a collection that guarantees that no
duplicates are stored and all elements can be accessed in natural order.
Which interface provides that capability?
Option B is correct. A set is a collection that contains no duplicate
elements. The iterator returns the elements in no particular order
(unless this set is an instance of some class that provides a
guarantee). A map cannot contain duplicate keys but it may contain
duplicate values. List and Collection allow duplicate elements.
Option A is wrong. A map is an object that maps keys to values. A map
cannot contain duplicate keys; each key can map to at most one value.
The Map interface provides three collection
views, which allow a map's contents to be viewed as a set of keys,
collection of values, or set of key-value mappings. The order of a map
is defined as the order in which the iterators on the map's collection
views return their elements. Some map implementations, like the TreeMap class, make specific guarantees as to their order (ascending key order); others, like the HashMap class, do not (does not guarantee that the order will remain constant over time).
Option C is wrong. A list is an ordered collection (also known as a
sequence). The user of this interface has precise control over where in
the list each element is inserted. The user can access elements by their
integer index (position in the list), and search for elements in the
list. Unlike sets, lists typically allow duplicate elements.
Option D is wrong. A collection is an ordered collection (also known
as a sequence). The user of this interface has precise control over
where in the list each element is inserted. The user can access elements
by their integer index (position in the list), and search for elements
in the list. Unlike sets, lists typically allow duplicate elements.
Q. No. :
11
Question :
Which two of the following methods are defined in class Thread?
(1) and (4). Only start() and run() are defined by the Thread class.
(2) and (3) are incorrect because they are methods of the Object class. (5) is incorrect because there's no such method in any thread-related class.
Q. No. :
12
Question :
You want a class to have access to members of another class in the same package. Which is the most restrictive access that accomplishes this objective?
The only two real contenders are C and D. Protected
access Option C makes a member accessible only to classes in the same
package or subclass of the class. While default access Option D makes a
member accessible only to classes in the same package.
Q. No. :
13
Question :
Which of the following is not a memory area in an executable C program?
A :
Stack area
B :
Queue area
C :
Heap area
D :
Code area
Answer: B
Q. No. :
14
Question :
Which of the following sentence is the correct description for the following declaration?
void(*x[10]) ();
A :
x is an array[10] of pointer to function returning type void.
B :
x is an array[10] of pointer to function returning type void*.
C :
x is an array of ten function returning type void.
D :
x is a pointer to an array of ten pointer to function returning type void.
Answer: A
Q. No. :
15
Question :
What will be
output if you will execute following c code?
int main() { char arr[30]="hello"; char *p= arr; (*p)++; printf("%s,", p ); p++; printf("%s",p); }
A :
ello, iello
B :
iello, ello
C :
hello, ello
D :
ello, hello
Answer: B
Q. No. :
17
Question :
What is the difference between the functions memcpy and memmove?
A :
memcpy is declared in <string.h> and memmove is declared in <stdlib.h>.
B :
memcpy copies the string whereas memmove copies as well as move the strings.
C :
memcpy is for non-overlapping memory areas whereas memmove can be used for overlapping memory areas.
D :
memcpy is portable whereas memmove is non-portable.
Answer: C
Q. No. :
18
Question :
Find out the error in following block of code.
If (x = 100)
Cout << “x is 100”;
A :
100 should be enclosed in quotations
B :
There is no semicolon at the end of first line
C :
Equals to operator mistake
D :
Variable x should not be inside quotation
Answer: C
Q. No. :
19
Question :
Observe the following block of code and determine what happens when x=2?
switch (x){
case 1:
case 2:
case 3:
cout<< "x is 3, so jumping to third branch";
goto thirdBranch;
default:
cout<<"x is not within the range, so need to say Thank You!";
}
A :
Program jumps to the end of switch statement since there is nothing to do for x=2
B :
The code inside default will run since there is no task for x=2, so, default task is run
C :
Will display x is 3, so jumping to third branch and jumps to third Branch.
D :
None of above
Answer: C
Q. No. :
20
Question :
Identify the correct statement regarding scope of variables
A :
Global variables are declared in a separate file and accessible from any program.
B :
Local variables are declared inside a function and accessible within the function only.
C :
Global variables are declared inside a function and accessible from anywhere in program.
D :
Local variables are declared in the main body of the program and accessible only from functions.
Answer: B
Q. No. :
21
Question :
Examine the following program and determine the output
#include <iostream>
using namespace std;
int operate (int a, int b)
{
return (a * b);
}
float operate (float a, float b)
{
return (a/b);
}
int main()
{
int x=5, y=2;
float n=5.0, m=2.0;
cout << operate(x,y) <<"\t";
cout << operate (n,m);
return 0;
}
A :
10.0, 5.0
B :
5.0, 2.5
C :
10.0, 5
D :
10, 2.5
Answer: D
Q. No. :
22
Question :
In an n-node binary tree traversal, what is the total number of steps required for a full traversal?
A :
n
B :
n-1
C :
2(n-1)
D :
2n
Answer: C
Q. No. :
23
Question :
Suppose that the internal bit string representation of a key is 010111001010110 and 5 bits are allowed in the index. What will be the hash value by using folding method?
A :
01111
B :
11110
C :
01011
D :
10101
Answer: A
Q. No. :
24
Question :
Which of the following permutations can be obtained in the output (in the same order) using a stack assuming that the input is a sequence 1,2,3,4,5in that order?
A :
3,4,5,1,2
B :
3,4,5,2,1
C :
1,5,2,3,4
D :
5,4,3,1,2
Answer: B
Q. No. :
25
Question :
Suppose T is binary search tree. which of the following statements about T is TRUE?
A :
Preorder traversal of T will yield a sorted listing of the elements of T.
B :
Inorder traversal of T will yield a sorted listing of the elements of T.
C :
Postorder traversal of T will yield a sorted listing of the elements of T.
D :
Inorder traversal as well as Postorder traversal of T will yield a sorted listing the elements of T.
Answer: B
Q. No. :
26
Question :
Which of the following statements are correct? (i). A stack may be viewed as descending priority queue. (ii).A queue may be viewed as descending priority queue. (iii).A queue may be viewed as ascending priority queue. (iv).A stack may be viewed as ascending priority queue.
A :
(i), (ii)
B :
(i),(iii)
C :
(ii),(iv)
D :
(iii),(iv)
Answer: B
Q. No. :
27
Question :
In __________ strategy a transaction is not allowed to modify the physical database until the undo portion of the log is written to stable storage.
A :
centralized log
B :
write-back-log
C :
write-ahead-log
D :
None of these
Answer: C
Q. No. :
28
Question :
State which of the following is True or False? (i). The value of NULL is ignored in any aggregation. (ii). NULL is treated as an ordinary value in a grouped attribute.
A :
True, True
B :
True, False
C :
False, True
D :
False, False
Answer: A
Q. No. :
29
Question :
Which of the following cannot be a triggering event for a trigger?
A :
INSERT
B :
DELETE
C :
UPDATE
D :
None of these
Answer: D
Q. No. :
30
Question :
We have the following relation schemas : Patient(patient_name,patient_addr,Treating_doctor); Hospitalcharges(patient_name,hospitalchargeid,typeofcharge,amount); Doctorcharges(patient_name,doctorchargeid,typeofchargeid,amount) Suppose we have query as, (SELECT patient_name FROM doctorcharges) EXCEPTALL (SELECT patient_name FROM hospitalcharges) If Jones has 3 doctorcharge bill and 1 hospitalcharge bill, how many tuples with the name Jones in the result?
A :
4 tuples
B :
3 tuples
C :
2 tuples
D :
1 tuples
Answer: C
Q. No. :
31
Question :
Suppose a relation has a degree of 7 and cardinality of 15. How many attributes(A) does this relation have and how many different rows (R) are currently present in the relation?