Selection Test Prep - MCQ
Selection Test Prep - MCQ
Q.2 Water consists of hydrogen and oxygen, and the approximate ratio, by mass, of hydrogen to
oxygen is 2:16. Approximately how many grams of oxygen are there in 144 grams of water?
a. 142
b. 128
c. 112
d. 16
Q.3 How many prime numbers between 1 and 100 are factors of 7,150?
a. Five
b. Two
c. One
d. Four
Q.5 Read the information given below and answer the question that follows. There are four friends
namely Arjun, Bheem, Chanakya and Dharma. Each person plays one outdoor game and has one
hobby related to fine arts. Two persons are interested in cricket while the other two like to play
hockey. Two of these four persons are painters, one is a singer and the fourth one is a dancer. Arjun
is neither a painter nor a hockey player. Bheem does not dance. The one who likes dancing, plays
hockey. Bheem and
Dharma don't play cricket. Who amongst the following plays cricket and is interested in painting?
a. Bheem
b. Dharma
c. Arjun
d. Chanakya
Q.6 In a certain code language, ‘We do different things’ is written as ‘ne tz iq dp’ ‘Do good deeds
always’ is written as ‘ge qd dp yc’ ‘We hate evil deeds’ is written as ‘um ol qd tz’ ‘Some persons like
evil good’ is written as ‘yc rc um tl zp’ What does the code "˜ol" stands for in the given code
language?
a. deeds
b. evil
c. hate
d. we
Q.7 Tiya is older than Eric. Cherry is older than Tiya. Eric is older than Cherry. If the first two
statements are true, the third statement is
a. True
b. False
c. Uncertain
d. Illogical
Q.8 A Girl buys 18 clips (brown or white) for Rs. 100. For every white clip, she pays one rupee more
than the brown clip. What is the cost of white clip & how much did she buy?
a. 5,13
b. 5,10
c. 6,10
d. None of these
Q.9 Riya takes 7 days to paint a Wall completely whereas Raj would require 9 days to paint the
same Wall completely. How many days will take to paint the Wall if both them work together. (Give
answers to the nearest integer)?
a. 4
b. 2
c. 5
d. 3
Q.10 In a 3*3 square grid comprising 9 tiles each tile can be painted in Pink or blue color. When the
tile is rotated by 180 degree, there is no difference which can be spotted. How many such
possibilities are there?
a. 16
b. 32
c. 64
d. 256
Q.11 What would be the output of the following code snippet? class output { public static void
main(String args[]) { String c = "Hello i love java"; boolean var; var = c.startsWith("hello");
System.out.println(var); } }
a. 0
b. True
c. 1
d. False
Q.12 Which of these literals can be contained in float data type variable?
a. 1.7E+308
b. -3.4E+50
c. -1.7E+308
d. -3.4E+38
Q.14 What will be the output of the following Java code? class Relational_operator { public static
void main(String args[]) { int var1 = 5; int var2 = 6; System.out.print(var1 > var2); }}
a. 0
b. True
c. False
d. 1
Q.15 We have been given a situation in which assignment operation is very costly. Now, Which of
the following sorting algorithm should be performed so that the number of assignment operations
is minimized in general?
a. Heap sort
b. none of these
c. Selection sort
d. Insertion sort
Q.16 What is the output of this C code? int main() { int i = 10; void *p = &i; printf("%d\n" (int)*p);
return 0; }
a. None of these
b. Error
c. 10
d. Garbage value
Q.17 The average search time of hashing with linear probing will be less if the load factor
a. none of these
b. equals one
c. is far less than one
d. is far greater than one
Q.18 Riya stores n data elements in a hash table. She is able to get the best efficiency achievable by
a hash table. What is the time complexity of accessing any element from this hash table?
a. O(log n)
b. O(1)
c. O(n log n)
d. O(n)
Q.19 Two lists, X and Y are implemented as singly linked-lists. The address of the first and last node
are stored in variables firstX and lastX for list X and firstY and lastY for list Y. Given the address of a
node is given in the variable node, the element stored in the node can be accessed by the
statement node->data and the address to the next node can be accessed by node- >next. Shiny
wants to append list Y at end of list X. Which of the following statements should She use?
a. lastY = firstX
b. lastX->next = firstY
c. lastX = firstY
d. lastY -> next = firstX
Q.21 What is the time complexity of following code: int i, j, k = 0; for (i = n / 2; i <= n; i++) { for (j = 2;
j <= n; j = j * 2) { k = k + n / 2; } }
a. O(n)
b. O(n log n)
c. O(n^2 log n)
d. O(n^2)
Q.22 Which of the following operator can be used with a multiple-row subquery?
a. equal(=)
b. BETWEEN
c. NOT IN
d. <>
Q.23 Which of the following statement is correct to display all the names with the name, subject,
and marks whose marks is in the range of 60 to 75 from the 'student' table?
a. SELECT * FROM student WHERE marks BETWEEN 60 AND 75;
b. SELECT * FROM student WHERE marks NOT IN (60 AND 75);
c. SELECT * FROM student WHERE marks NOT BETWEEN 60 AND 75;
d. SELECT * FROM student WHERE marks IN (60 to 75);
Q.24 If ROSE is coded as 6821, CHAIR is coded as 73456 and PREACH is coded as 961473, what will
be the code for SEARCH?
a. 214763
b. 216473
c. 246713
d. 214673
Q.25 What will be the output of the following Java program? class comma_operator { public static
void main(String args[]) { int sum = 0; for (int i = 0, j = 0; i < 5 & j < 5; ++i, j = i + 1) sum += i;
System.out.println(sum); } }
a. 14
b. compilation error
c. 6
d. 5
Q.26 What will be the output of the following Java code? class multidimention_array { public static
void main(String args[]) { int arr[][] = new int[3][]; arr[0] = new int[1]; arr[1] = new int[2]; arr[2] =
new int[3]; int sum = 0; for (int i = 0; i < 3; ++i) { for (int j = 0; j < i + 1; ++j) { arr[i][j] = j + 1; } } for (int i
= 0; i < 3; ++i){ for (int j = 0; j < i + 1; ++j) { sum+= arr[i][j]; } } System.out.print(sum); } }
a. 14
b. 13
c. 11
d. 10
Q.27 Which data type value is returned by all transcendental math functions?
a. double
b. int
c. float
d. long
Q.28 What will be the output of the following Java code? class operators { public static void
main(String args[]) { int var1 = 5; int var2 = 6; int var3; var3 = ++ var2 * var1 / var2 + var2;
System.out.print(var3);
}}
a. 12
b. 10
c. 11
d. 56
Q.30 What will be the output of the following Java program? class variable_scope { public static
void main(String args[]) { int x; x = 5; { int y = 6; System.out.print(x + " " + y); } System.out.println(x +
" " + y); } }
a. Runtime error
b. 5 6 5
c. 5 6 5 6
d. Compilation error
Q.31 The post order traversal of a binary tree is DEBFCA. Find out the pre-order traversal
a. ABDECF
b. ABDCEF
c. ABCFDE
d. ABFCDE
Q.32 What would be the output after performing the following operations in a Deque?
Insertfront(50); Insertfront(60); Insertrear(70); Insertrear(80); Deletefront(); Insertfront(90);
Deleterear(); Display(); ;
a. none of these
b. 80,60,70
c. 90,50,70
d. 50,60,70
Q.33 What is the postfix expression for the following infix expression? (A + B) * (C + D) * (P+Q)
a. AB+CD+PQ+**
b. None of these
c. **ABCDPQ+++
d. A B+ C D+ * PQ+*
Q.34 Consider the following relation : Cinema(theater, address, capacity) Which of the following
options will be needed at the end of the SQL query SELECT P1.address FROM Cinema P1 such that it
always finds the addresses of theaters with maximum capacity?
a. WHERE P1.capacity >= All(select P2.capacity from Cinema P2)
b. WHERE P1.capacity> Any(select max(P2.capacity) from Cinema P2)
c. WHERE P1.capacity > All (select max(P2. capacity) from Cinema P2)
d. WHERE P1.capacity >= Any(select P2.capacity from Cinema P2)
Q.35 Given the following statements: S1: A foreign key declaration can always be replaced by an
equivalent check assertion in SQL. S2: Given the table R(a,b,c) where a and b together form the
primary key, the following is a valid table definition.
CREATE TABLE S ( a INTEGER, d INTEGER, e INTEGER, PRIMARY KEY (d), FOREIGN KEY (a) references
R) Which one of the following statements is CORRECT?
a. Both S1 and S2 are FALSE
b. S1 is FALSE and S2 is TRUE
c. Both S1 and S2 are TRUE
d. S1 is TRUE and S2 is FALSE
Q.36 Which of the following statements are TRUE about an SQL query? P : An SQL query can
contain a HAVING clause even if it does not have a GROUP BY clause Q : An SQL query can contain a
HAVING clause only if it has a GROUP BY clause R : All attributes used in the GROUP BY clause must
appear in the SELECT clause S : Not all attributes used in the GROUP BY clause need to appear in
the SELECT clause
a. P and R
b. P and S
c. Q and R
d. Q and S
Q.37 If every non-key attribute is functionally dependent on the primary key, then the relation will
be in :
a. 4NF
b. 3NF
c. 2NF
d. 1NF
Q.38 Every time attribute X appears, it is matched with the same value of attribute Y, but not the
same value of attribute Z. Therefore, it is true that:
a. (Y, Z) -> X
b. X -> (Y, Z)
c. Y,Z
d. X -> Y
Q.39 How to select all data from the product table starting the name from letter 's'?
a. SELECT * FROM product WHERE name LIKE 's%';
b. SELECT * FROM product WHERE name LIKE '_s%';
c. SELECT * FROM product WHERE name LIKE '%s';
d. SELECT * FROM product WHERE name LIKE '%s%';
Q.46 There are 10 different processes running on a workstation. Idle processes are waiting for an
input event in the input queue. Busy processes are scheduled with the Round-Robin time sharing
method. Which out of the following quantum times is the best value for small response times, if the
processes have a short runtime, e.g. less than 10ms?
a. tQ = 15ms
b. tQ = 40ms
c. tQ = 45ms
d. tQ = 50ms
Q.48 Which amongst the following is the fastest, in terms of memory access?
a. SRAM
b. cache
c. DRAM
d. Cache Memory
Q.49 Which one of the following expressions does NOT represent exclusive NOR of x and y?
a. x'⊕y
b. xy+x'y'
c. x'⊕y'
d. x⊕y'
Q.51 In the question, two statements are given, followed by two conclusions, I and II. You have to
consider the statements to be true even if it seems to be at variance from commonly known facts.
You have to decide which of the given conclusions, if any, follows from the given statements.
Statements: No cities are countries. No countries are villages. Conclusions: I. Some countries are
city. II. No villages are city.
a. Only conclusion I follows
b. Only conclusion II follows
c. Only conclusion I and II follow
d. Neither conclusion I nor conclusion II follows
Q.52 Today Rebecca, who is 34 years old, and her daughter, who is 8 years old, celebrate their
birthdays. How many years will pass before Rebecca's age is twice her daughter's age?
a. 22
b. 18
c. 10
d. 14
Q.53 If the roots of the equation (x+1)(x+9)+8=0 are a and b, then the roots of the equation
(x+a)(x+b)-8=0 are
a. (-4 and -6)
b. 4 and 6
c. (-1 and -9)
d. 1 and 9
Q.54 Lucy invested $10,000 in a new mutual fund account exactly three years ago. The value of the
account increased by 10 percent during the first year, increased by 5 percent during the second
year, and decreased by 10 percent during the third year. What is the value of the account today?
a. $10395
b. $10500
c. $11500
d. $12705
Q.55 Pumping alone at their respective constant rates, one inlet pipe fills an empty tank to 1/2 of
capacity in 3 hours and a second inlet pipe fills the same empty tank to 2/3 of capacity in 6 hours.
How many hours will it take both pipes, pumping simultaneously at their respective constant rates,
to fill the empty tank to capacity?
a. 3.6
b. 3.25
c. 4.2
d. 4.4
Q.56 In the equation y = kx + 3, k is a constant. If y=17 when x=2, what is the value of y when x=4?
a. 11
b. 14
c. 31
d. 34
Q.60 Riya goes 30 km towards North from a fixed point, then after turning to her right she goes 15
km. After this she goes 30 km after turning to her right. How far and in what direction is she from
her starting point?
a. 30
b. 20
c. 10
d. 15
Q.63 How can the user change “Amazon” into “Google” in the “Name” column in the companies
table?
a. UPDATE companies SET Name = 'Amazon' INTO Name = 'Google';
b. MODIFY companies SET Name = 'Google' WHERE Name = 'Amazon';
c. MODIFY companies SET Name = 'Amazon' INTO Name = 'Google';
d. UPDATE companies SET Name = 'Google' WHERE Name = 'Amazon';
Q.65 which of the following query is correct for using comparision operators in SQL?
a. None of these
b. SELECT name, course_name FROM student WHERE age>50 and WHERE age<80;
c. SELECT name, course_name FROM student WHERE age>50 and age<80;
d. SELECT name, course_name FROM student WHERE age>50 and <80;
Q.66 which of the following command makes the updates performed by the transaction permanent
in the database
a. DELETE
b. TRUNCATE
c. COMMIT
d. ROLLBACK
Q.68 If we want to add a column named "DateOfBirth" in the "Persons" table which of the following
is true?
a. ALTER TABLE Persons ADD DateOfBirth date;
b. ALTER TABLE Persons
c. ALTER TABLE Persons DateOfBirth date;
d. ALTER TABLE Persons ADD DateOfBirth
Q.69 What would this line do? INSERT INTO Flowers (name, colour) VALUES (‘Rose’, ‘Red’)
a. Add a row to the flowers table with name red and the colour rose.
b. Create the table rose.
c. Add a row to the flowers table with the name rose and colour red.
d. Add a table to the flowers database with the name rose and colour red.
Q.70 This Query can be replaced by which one of the following? SELECT product_name, product_id
FROM cloths, cosmetics WHERE cloths_id= cosmetics_id;
a. Select product_id from cloths join cosmetics;
b. Select product_name, product_id from cloths natural join cosmetics;
c. Select product_name, product_id from cloths;
d. Select product_name, product_id from cosmetics, cloths where cloths_id=product_id;
Q.71 Alex has a book of tickets and wants to store ticket numbers in a data structure but New
tickets are added to the end of the booklet and Ticket at the top of the stack is issued to the
customer. Which data structure is best suited for Alex to represent the ticket booklet?
a. Graph
b. Queue
c. Array
d. Stack
Q.72 what would be the output of the following code snippet? void main() { int a[] =
{11,12,66,88,99}, *p; p = a; ++*p; printf("%d ", *p); p += 2; printf("%d ", *p); }
a. 12 66
b. 12 88
c. 11 12
d. None of these
Q.74 Which of the following is the space complexity for deleting a linked list?
a. O(n)
b. O(1)
c. Either O(1) or O(n)
d. O(logn)
Q.75 What is the prefix expression for the following infix expression? AB*C/(E-F)
a. None of these
b. AB*CEF/-
c. ABCF*E/
d. *AB/C-EF
Q.76 Given an empty queue (Q) in which the following operations are performed: ADD 7 ADD 8
ADD 40 DELETE ADD 32 DELETE DELETE ADD 11 What will be the content of Q after these
operations. Front is marked by (F) and Rear is marked by (R).
a. 11(R) 32(F)
b. 7(R) 11(F)
c. 32(R) 11(F)
d. 8(R) 7(F)
Q.77 Suppose we have numbers between 1 and 1000 in a binary search tree and we want to search
for the number 363. Which of the following sequence could not be the sequence of the node
examined?
a. 2, 252, 401, 398, 330, 344, 397, 363
b. 924, 220, 911, 244, 898, 258, 362, 363
c. 925, 202, 911, 240, 912, 245, 258, 363
d. 2, 399, 387, 219, 266, 382, 381, 278, 363
Q.78 Consider a situation where you have been given a task of rearranging the library books in a
shelf in proper order, at the end of each day. The ideal choice will be
a. heap sort
b. selection sort
c. insertion sort
d. Bubble sort
Q.79 Amily writes a program to find an element in the array A[5] with the following elements in
order: 8 30 40 45 70. She runs the program to find a number A. A is found in the first iteration of
binary search. What is the value of A?
a. 8
b. 30
c. 70
d. 40
Q.80 Find the time complexity of the following code snippets for(i= 0; i < n; i++){ for(j = 1; j < n; j =
j*2){ cout << i << " "; } }
a. O(n log n)
b. O(log n)
c. O(n)
d. O(1)
Q.81 What will be the output of the following Java code? class String_demo {
public static void main(String args[]) { char chars[] = {'a', 'b', 'c'}; String s = new String(chars);
System.out.println(s); } }
a. abc
b. b
c. c
d. a
Q.82 What is the value stored in x in the following lines of Java code? int x, y, z; x = 0; y = 1; x = y = z
= 8;
a. 8
b. 9
c. 1
d. 0
Q.83 What should be expression1 evaluate to in using ternary operator as in this line? expression1
? expression2 : expression3
a. Integer
b. Boolean
c. None of the mentioned
d. Floating – point numbers
Q.84 An expression involving byte, int, and literal numbers is promoted to which of these?
a. float
b. byte
c. long
d. int
Q.85 What will be the output of the following Java program? class operator { public static void
main(String args[]) { int a = 3; int b = 6;
int c = a | b; int d = a & b; System.out.println(c + “ “ + d); } }
a. 7 5
b. 5 2
c. 7 7
d. 7 2
Q.86 What will be the output of the following Java code? class HelloWorld { public static void
main(String[] args) { int arr[] = new int [5]; System.out.print(arr); } }
a. Class name@ hashcode in hexadecimal form
b. 0.0arr[0]
c. 0
d. value stored in arr[0]
Q.88 What will be the output of the following Java code? class Output { public static void
main(String args[]) { int x , y = 1; x = 10; if (x != 10 && x / 0 == 0) System.out.println(y); else
System.out.println(++y); } }
a. Runtime error owing to division by zero in if condition
b. 2
c. 1
d. Unpredictable behavior of program
Q.90 What would be the output of the following code snippet? class output { public static void
main(String args[]) { String c = "Hello i love java"; boolean var; var = c.startsWith("hello");
System.out.println(var); } }
a. FALSE
b. 1
c. TRUE
d. 0
Q.91 the process of transferring files from a computer on the internet to your computer is
called_______.
a. downloading
b. uploading
c. ftp
d. jpeg
Q.92 Which one of the following is the most common internet protocol?
a. HTML
b. NetBEUI
c. TCP/IP
d. IPX/SPX
Q.94 What is it called where child object gets killed if parent object is killed?
a. Aggregation
b. composition
c. encapsulation
d. association
Q.95 Express the decimal format of the signed binary number (10010)2 .
a. 2
b. 12
c. -12
d. -2
Q.97 Which of the following storage retains its data after the power is turned off?
a. Sequential storage
b. Volatile storage
c. Direct storage
d. Non-volatile storage
Q.98 Which among the following logic gates provides the output as zero when both the inputs are
same (either 0 or 1)?
a. XNOR
b. XOR
c. NOR
d. NAND
Q.99 Which of the following statements are true? I. Shortest remaining time first scheduling may
cause starvation II. Preemptive scheduling may cause starvation III. Round robin is better than FCFS
in terms of response time
a. I Only
b. I and III Only
c. II and III Only
d. I,II and III
Q.100 If a parent process is killed by a child process, then which of the following is a true statement
a. It is not possible, child process can not kill parent process
b. The child process also will terminate automatically
c. The child becomes an orphan & is adopted by some other process
d. The session leader terminates all the process for that group ID