

MCQOPTIONS
Saved Bookmarks
This section includes 50 Mcqs, each offering curated multiple-choice questions to sharpen your Computer Science knowledge and support exam preparation. Choose a topic below to get started.
1. |
Let X denote the Exclusive OR (XOR) operation. Let ‘1’ and ‘0’ denote the binary constants. Consider the following Boolean expression for F over two variables P and Q: F(P, Q) = ( ( 1 X P) X (P X Q) ) X ( (P X Q) X (Q X 0) ) The equivalent expression for F is |
A. | P + Q |
B. | (P + Q) |
C. | P X Q |
D. | (P X Q) |
Answer» E. | |
2. |
Consider the following relational schema: employee(empId, empName, empDept) customer(custId, custName, salesRepId, rating) salesRepId is a foreign key referring to empId of the employee relation. Assume that each employee makes a sale to at least one customer. What does the following query return? SELECT empName FROM employee E WHERE NOT EXISTS (SELECT custId FROM customer C WHERE C.salesRepId = E.empId AND C.rating <> `GOOD`); |
A. | Names of all the employees with at least one of their customers having a ‘GOOD’ rating. |
B. | Names of all the employees with at most one of their customers having a ‘GOOD’ rating. |
C. | Names of all the employees with none of their customers having a ‘GOOD’ rating. |
D. | Names of all the employees with all their customers having a ‘GOOD’ rating |
Answer» E. | |
3. |
Consider the set of all functions f: {0,1, … ,2014} → {0,1, … ,2014} such that f(f(i)) = i, for all 0 ≤ i ≤ 2014. Consider the following statements: P. For each such function it must be the case that for every i, f(i) = i. Q. For each such function it must be the case that for some i, f(i) = i. R. Each such function must be onto. Which one of the following is CORRECT? |
A. | P, Q and R are true |
B. | Only Q and R are true |
C. | Only P and Q are true |
D. | Only R is true |
Answer» C. Only P and Q are true | |
4. |
Let d denote the minimum degree of a vertex in a graph. For all planar graphs on n vertices with d ≥ 3, which one of the following is TRUE? |
A. | In any planar embedding, the number of faces is at least n/2 + 2 |
B. | In any planar embedding, the number of faces is less than n/2 + 2 |
C. | There is a planar embedding in which the number of faces is less than n/2 + 2 |
D. | There is a planar embedding in which the number of faces is at most n/(d+1) |
Answer» B. In any planar embedding, the number of faces is less than n/2 + 2 | |
5. |
If G is a forest with n vertices and k connected components, how many edges does G have? |
A. | floor(n/k) |
B. | ceil(n/k) |
C. | n-k |
D. | n-k+1 |
Answer» D. n-k+1 | |
6. |
There are two elements x, y in a group (G,∗) such that every element in the group can be written as a product of some number of x's and y's in some order. It is known that x ∗ x = y ∗ y = x ∗ y ∗ x ∗ y = y ∗ x ∗ y ∗ x = e where e is the identity element. The maximum number of elements in such a group is |
A. | 2 |
B. | 3 |
C. | 4 |
D. | 5 |
Answer» D. 5 | |
7. |
Let S be the sample space and two mutually exclusive events A and B be such that A U B = S. If P(.) denotes the probability of the event. The maximum value of P(A)P(B) is ______ |
A. | 0.5 |
B. | 0.25 |
C. | 0.225 |
D. | 0.125 |
Answer» C. 0.225 | |
8. |
The memory access time is 1 nanosecond for a read operation with a hit in cache, 5 nanoseconds for a read operation with a miss in cache, 2 nanoseconds for a write operation with a hit in cache and 10 nanoseconds for a write operation with a miss in cache. Execution of a sequence of instructions involves 100 instruction fetch operations, 60 memory operand read operations and 40 memory operand write operations. The cache hit-ratio is 0.9. The average memory access time (in nanoseconds) in executing the sequence of instructions is __________. |
A. | 1.26 |
B. | 1.68 |
C. | 2.46 |
D. | 4.52 |
Answer» C. 2.46 | |
9. |
An instruction pipeline has five stages, namely, instruction fetch (IF), instruction decode and register fetch (ID/RF), instruction execution (EX), memory access (MEM), and register writeback (WB) with stage latencies 1 ns, 2.2 ns, 2 ns, 1 ns, and 0.75 ns, respectively (ns stands for nanoseconds). To gain in terms of frequency, the designers have decided to split the ID/RF stage into three stages (ID, RF1, RF2) each of latency 2.2/3 ns. Also, the EX stage is split into two stages (EX1, EX2) each of latency 1 ns. The new design has a total of eight pipeline stages. A program has 20% branch instructions which execute in the EX stage and produce the next instruction pointer at the end of the EX stage in the old design and at the end of the EX2 stage in the new design. The IF stage stalls after fetching a branch instruction until the next instruction pointer is computed. All instructions other than the branch instruction have an average CPI of one in both the designs. The execution times of this program on the old and the new design are P and Q nanoseconds, respectively. The value of P/Q is __________. |
A. | 1.5 |
B. | 1.4 |
C. | 1.8 |
D. | 2.5 |
Answer» B. 1.4 | |
10. |
Consider the C function given below. Assume that the array listA contains n (> 0) elements, sorted in ascending order. int ProcessArray(int *listA, int x, int n) { int i, j, k; i = 0; j = n-1; do { k = (i+j)/2; if (x <= listA[k]) j = k-1; if (listA[k] <= x) i = k+1; } while (i <= j); if (listA[k] == x) return(k); else return -1; } Which one of the following statements about the function ProcessArray is CORRECT? |
A. | It will run into an infinite loop when x is not in listA |
B. | It is an implementation of binary search |
C. | It will always find the maximum element in listA |
D. | It will return −1 even when x is present in listA. |
Answer» C. It will always find the maximum element in listA | |
11. |
Consider the pseudocode given below. The function DoSomething() takes as argument a pointer to the root of an arbitrary tree represented by the leftMostChild-rightSibling representation. Each node of the tree is of type treeNode. typedef struct treeNode* treeptr; struct treeNode { treeptr leftMostChild, rightSibling; }; int DoSomething (treeptr tree) { int value=0; if (tree != NULL) { if (tree->leftMostChild == NULL) value = 1; else value = DoSomething(tree->leftMostChild); value = value + DoSomething(tree->rightSibling); } return(value); } When the pointer to the root of a tree is passed as the argument to DoSomething, the value returned by the function corresponds to the |
A. | number of internal nodes in the tree |
B. | height of the tree. |
C. | number of nodes without a right sibling in the tree |
D. | number of leaf nodes in the tree |
Answer» E. | |
12. |
Consider a hash table with 100 slots. Collisions are resolved using chaining. Assuming simple uniform hashing, what is the probability that the first 3 slots are unfilled after the first 3 insertions? |
A. | (97 × 97 × 97)/1003 |
B. | (99 × 98 × 97)/1003 |
C. | (97 × 96 × 95)/1003 |
D. | (97 × 96 × 95)/(3! × 1003) |
Answer» B. (99 × 98 × 97)/1003 | |
13. |
Suppose we have a balanced binary search tree T holding n numbers. We are given two numbers L and H and wish to sum up all the numbers in T that lie between L and H. Suppose there are m such numbers in T. If the tightest upper bound on the time to compute the sum is O(nalogb n + mc logd n), the value of a + 10b + 100c + 1000d is ____. |
A. | 60 |
B. | 110 |
C. | 210 |
D. | 50 |
Answer» C. 210 | |
14. |
Suppose you want to move from 0 to 100 on the number line. In each step, you either move right by a unit distance or you take a shortcut. A shortcut is simply a pre-specified pair of integers i, j with i < j. Given a shortcut i, j if you are at position i on the number line, you may directly move to j. Suppose T(k) denotes the smallest number of steps needed to move from k to 100. Suppose further that there is at most 1 shortcut involving any number, and in particular from 9 there is a shortcut to 15. Let y and z be such that T(9) = 1 + min(T(y), T(z)). Then the value of the product yz is _____. |
A. | 50 |
B. | 100 |
C. | 150 |
D. | 200 |
Answer» D. 200 | |
15. |
Which of the following problems is undecidable? |
A. | Deciding if a given context-free grammar is ambiguous |
B. | Deciding if a given string is generated by a given context-free grammar |
C. | Deciding if the language generated by a given context-free grammar is empty |
D. | Deciding if the language generated by a given context-free grammar is finite |
Answer» B. Deciding if a given string is generated by a given context-free grammar | |
16. |
Consider the basic block given below. a = b + c c = a + d d = b + c e = d - b a = e + b The minimum number of nodes and edges present in the DAG representation of the above basic block respectively are |
A. | 6 and 6 |
B. | 8 and 10 |
C. | 9 and 12 |
D. | 4 and 4 |
Answer» B. 8 and 10 | |
17. |
Consider a paging hardware with a TLB. Assume that the entire page table and all the pages are in the physical memory. It takes 10 milliseconds to search the TLB and 80 milliseconds to access the physical memory. If the TLB hit ratio is 0.6, the effective memory access time (in milliseconds) is _________. |
A. | 120 |
B. | 122 |
C. | 124 |
D. | 118 |
Answer» C. 124 | |
18. |
An operating system uses shortest remaining time first scheduling algorithm for pre-emptive scheduling of processes. Consider the following set of processes with their arrival times and CPU burst times (in milliseconds): Process Arrival Time Burst Time P1 0 12 P2 2 4 P3 3 6 P4 8 5 The average waiting time (in milliseconds) of the processes is _________. |
A. | 4.5 |
B. | 5.0 |
C. | 5.5 |
D. | 6.5 |
Answer» D. 6.5 | |
19. |
A system contains three programs and each requires three tape units for its operation. The minimum number of tape units which the system must have such that deadlocks never arise is _________. |
A. | 6 |
B. | 7 |
C. | 8 |
D. | 9 |
Answer» C. 8 | |
20. |
Consider the relational schema given below, where eId of the relation dependent is a foreign key referring to empId of the relation employee. Assume that every employee has at least one associated dependent in the dependent relation. employee (empId, empName, empAge) dependent(depId, eId, depName, depAge) Consider the following relational algebra query: GATECS2014Q40 The above query evaluates to the set of empIds of employees whose age is greater than that of |
A. | some dependent. |
B. | all dependents |
C. | some of his/her dependents |
D. | all of his/her dependents |
Answer» E. | |
21. |
Consider the transactions T1, T2, and T3 and the schedules S1 and S2 given below. T1: r1(X); r1(Z); w1(X); w1(Z) T2: r2(Y); r2(Z); w2(Z) T3: r3(Y); r3(X); w3(Y) S1: r1(X); r3(Y); r3(X); r2(Y); r2(Z); w3(Y); w2(Z); r1(Z); w1(X); w1(Z) S2: r1(X); r3(Y); r2(Y); r3(X); r1(Z); r2(Z); w3(Y); w1(X); w2(Z); w1(Z) Which one of the following statements about the schedules is TRUE? |
A. | Only S1 is conflict-serializable |
B. | Only S2 is conflict-serializable |
C. | C Both S1 and S2 are conflict-serializable |
D. | Neither S1 nor S2 is conflict-serializable |
Answer» B. Only S2 is conflict-serializable | |
22. |
An IP router with a Maximum Transmission Unit (MTU) of 1500 bytes has received an IP packet of size 4404 bytes with an IP header of length 20 bytes. The values of the relevant fields in the header of the third IP fragment generated by the router for this packet are |
A. | MF bit: 0, Datagram Length: 1444; Offset: 370 |
B. | MF bit: 1, Datagram Length: 1424; Offset: 185 |
C. | MF bit: 1, Datagram Length: 1500; Offset: 37 |
D. | MF bit: 0, Datagram Length: 1424; Offset: 2960 |
Answer» B. MF bit: 1, Datagram Length: 1424; Offset: 185 | |
23. |
Every host in an IPv4 network has a 1-second resolution real-time clock with battery backup. Each host needs to generate up to 1000 unique identifiers per second. Assume that each host has a globally unique IPv4 address. Design a 50-bit globally unique ID for this purpose. After what period (in seconds) will the identifiers generated by a host wrap around? |
A. | 128 |
B. | 64 |
C. | 256 |
D. | 512 |
Answer» D. 512 | |
24. |
Classless Inter-domain Routing (CIDR) receives a packet with address 131.23.151.76. The router’s routing table has the following entries: Prefix Output Interface Identifier 131.16.0.0/12 3 131.28.0.0/14 5 131.19.0.0/16 2 131.22.0.0/15 1 The identifier of the output interface on which this packet will be forwarded is ______. |
A. | 1 |
B. | 2 |
C. | 3 |
D. | 5 |
Answer» B. 2 | |
25. |
Host A (on TCP/IP v4 network A) sends an IP datagram D to host B (also on TCP/IP v4 network B). Assume that no error occurred during the transmission of D. When D reaches B, which of the following IP header field(s) may be different from that of the original datagram D? (i) TTL (ii) Checksum (iii) Fragment Offset |
A. | (i) only |
B. | (i) and (ii) only |
C. | (ii) and (iii) only |
D. | (i), (ii) and (iii) |
Answer» E. | |
26. |
A bit-stuffing based framing protocol uses an 8-bit delimiter pattern of 01111110. If the output bit-string after stuffing is 01111100101, then the input bit-string is |
A. | 0111110100 |
B. | 0111110101 |
C. | 0111111101 |
D. | 0111111111 |
Answer» C. 0111111101 | |
27. |
In the following pairs of OSI protocol layer/sub-layer and its functionality, the INCORRECT pair is |
A. | Network layer and Routing |
B. | Data Link Layer and Bit synchronization |
C. | Transport layer and End-to-end process communication |
D. | Medium Access Control sub-layer and Channel sharing |
Answer» C. Transport layer and End-to-end process communication | |
28. |
A prime attribute of a relation scheme R is an attribute that appears |
A. | in all candidate keys of R |
B. | in some candidate key of R |
C. | in a foreign key of R |
D. | only in the primary key of R |
Answer» C. in a foreign key of R | |
29. |
A system uses 3 page frames for storing process pages in main memory. It uses the Least Recently Used (LRU) page replacement policy. Assume that all the page frames are initially empty. What is the total number of page faults that will occur while processing the page reference string given below? 4, 7, 6, 1, 7, 6, 1, 2, 7, 2 |
A. | 4 |
B. | 5 |
C. | 6 |
D. | 7 |
Answer» D. 7 | |
30. |
In the context of modular software design, which one of the following combinations is desirable? |
A. | High cohesion and high coupling |
B. | High cohesion and low coupling |
C. | Low cohesion and high coupling |
D. | Low cohesion and low coupling |
Answer» C. Low cohesion and high coupling | |
31. |
Which of the following statements are CORRECT? 1) Static allocation of all data areas by a compiler makes it impossible to implement recursion. 2) Automatic garbage collection is essential to implement recursion. 3) Dynamic allocation of activation records is essential to implement recursion. 4) Both heap and stack are essential to implement recursion. |
A. | 1 and 2 only |
B. | 2 and 3 only |
C. | 3 and 4 only |
D. | 1 and 3 only |
Answer» E. | |
32. |
One of the purposes of using intermediate code in compilers is to |
A. | make parsing and semantic analysis simpler |
B. | improve error recovery and error reporting. |
C. | increase the chances of reusing the machine-independent code optimizer in other compilers. |
D. | improve the register allocation. |
Answer» D. improve the register allocation. | |
33. |
The length of the shortest string NOT in the language (over Σ = {a, b}) of the following regular expression is ______________. a*b*(ba)*a* |
A. | 2 |
B. | 3 |
C. | 4 |
D. | 5 |
Answer» C. 4 | |
34. |
You have an array of n elements. Suppose you implement quicksort by always choosing the central element of the array as the pivot. Then the tightest upper bound for the worst case performance is |
A. | O(n2) |
B. | O(nLogn) |
C. | Theta(nLogn) |
D. | Theta(nLogn) |
Answer» B. O(nLogn) | |
35. |
The minimum number of arithmetic operations required to evaluate the polynomial P(X) = X5 + 4X3 + 6X + 5 for a given value of X using only one temporary variable. |
A. | 6 |
B. | 7 |
C. | 8 |
D. | 9 |
Answer» C. 8 | |
36. |
Let A be a square matrix of size n x n. Consider the following program. What is the expected output? C = 100 for i = 1 to n do for j = 1 to n do { Temp = A[i][j] + C A[i][j] = A[j][i] A[j][i] = Temp - C } for i = 1 to n do for j = 1 to n do Output(A[i][j]); |
A. | The matrix A itself |
B. | Transpose of matrix A |
C. | Adding 100 to the upper diagonal elements and subtracting 100 from diagonal elements of A |
D. | None of the above |
Answer» B. Transpose of matrix A | |
37. |
Consider the following processors (ns stands for nanoseconds). Assume that the pipeline registers have zero latency. P1: Four-stage pipeline with stage latencies 1 ns, 2 ns, 2 ns, 1 ns. P2: Four-stage pipeline with stage latencies 1 ns, 1.5 ns, 1.5 ns, 1.5 ns. P3: Five-stage pipeline with stage latencies 0.5 ns, 1 ns, 1 ns, 0.6 ns, 1 ns. P4: Five-stage pipeline with stage latencies 0.5 ns, 0.5 ns, 1 ns, 1 ns, 1.1 ns. Which processor has the highest peak clock frequency? |
A. | P1 |
B. | P2 |
C. | P3 |
D. | P4 |
Answer» D. P4 | |
38. |
Consider the following combinational function block involving four Boolean variables x, y, a, b where x, a, b are inputs and y is the output. f (x, y, a, b) { if (x is 1) y = a; else y = b; } Which one of the following digital logic blocks is the most suitable for implementing this function? |
A. | Full adder |
B. | Priority encoder |
C. | Multiplexer |
D. | Flip-flop |
Answer» D. Flip-flop | |
39. |
If V1 and V2 are 4-dimensional subspaces of a 6-dimensional vector space V, then the smallest possible dimension of V1 ∩ V2 is ______. |
A. | 1 |
B. | 2 |
C. | 3 |
D. | 4 |
Answer» C. 3 | |
40. |
Which one of the following statements is TRUE about every |
A. | If the trace of the matrix is positive and the determinant of the matrix is negative, at least one of its eigenvalues is negative. |
B. | If the trace of the matrix is positive, all its eigenvalues are positive |
C. | If the determinant of the matrix is positive, all its eigenvalues are positive |
D. | If the product of the trace and determinant of the matrix is positive, all its eigenvalues are positive |
Answer» B. If the trace of the matrix is positive, all its eigenvalues are positive | |
41. |
Let G be a group with 15 elements. Let L be a subgroup of G. It is known that L != G and that the size of L is at least 4. The size of L is __________. |
A. | 3 |
B. | 5 |
C. | 7 |
D. | 9 |
Answer» C. 7 | |
42. |
Consider the following statements: P: Good mobile phones are not cheap Q: Cheap mobile phones are not good L: P implies Q M: Q implies P N: P is equivalent to Q Which one of the following about L, M, and N is CORRECT? |
A. | Only L is TRUE |
B. | Only M is TRUE |
C. | Only N is TRUE. |
D. | L, M and N are TRUE |
Answer» E. | |
43. |
Consider the equation: (7526)8 − (Y)8 = (4364)8 , where (X)N stands for X to the base N. Find Y. |
A. | 1634 |
B. | 1737 |
C. | 3142 |
D. | 3162 |
Answer» D. 3162 | |
44. |
The Gross Domestic Product (GDP) in Rupees grew at 7% during 2012-2013. For international comparison, the GDP is compared in US Dollars (USD) after conversion based on the market exchange rate. During the period 2012-2013 the exchange rate for the USD increased from Rs. 50/ USD to Rs. 60/ USD. India’s GDP in USD during the period 2012-2013 |
A. | increased by 5 % |
B. | decreased by 13% |
C. | decreased by 20% |
D. | decreased by 11% |
Answer» E. | |
45. |
By the beginning of the 20th century, several hypotheses were being proposed, suggesting a paradigm shift in our understanding of the universe. However, the clinching evidence was provided by experimental measurements of the position of a star which was directly behind our sun. Which of the following inference(s) may be drawn from the above passage? (i) Our understanding of the universe changes based on the positions of stars (ii) Paradigm shifts usually occur at the beginning of centuries (iii) Stars are important objects in the universe (iv) Experimental evidence was important in confirming this paradigm shift |
A. | (i), (ii) and (iv) |
B. | (iii) only |
C. | (i) and (iv) |
D. | (iv) only |
Answer» E. | |
46. |
A dance programme is scheduled for 10.00 a.m. Some students are participating in the programme and they need to come an hour earlier than the start of the event. These students should be accompanied by a parent. Other students and parents should come in time for the programme. The instruction you think that is appropriate for this is |
A. | Students should come at 9.00 a.m. and parents should come at 10.00 a.m |
B. | Participating students should come at 9.00 a.m. accompanied by a parent, and other parents and students should come by 10.00 a.m. |
C. | Students who are not participating should come by 10.00 a.m. and they should not bring their parents. Participating students should come at 9.00 a.m. |
D. | Participating students should come before 9.00 a.m. Parents who accompany them should come at 9.00 a.m. All others should come at 10.00 a.m. |
Answer» C. Students who are not participating should come by 10.00 a.m. and they should not bring their parents. Participating students should come at 9.00 a.m. | |
47. |
Which number does not belong in the series below? 2, 5, 10, 17, 26, 37, 50, 64 |
A. | 17 |
B. | 37 |
C. | 64 |
D. | 26 |
Answer» D. 26 | |
48. |
Choose the word that is opposite in meaning to the word “coherent” |
A. | sticky |
B. | well-connected |
C. | rambling |
D. | friendly |
Answer» D. friendly | |
49. |
If she _______________ how to calibrate the instrument, she _______________ done the experiment. |
A. | knows, will have |
B. | knew, had |
C. | had known, could have |
D. | should have known, would have |
Answer» D. should have known, would have | |
50. |
While trying to collect(I) an envelope from under the table (II), Mr. X fell down (III) and was losing consciousness (IV) Which one of the above underlined parts of the sentence is NOT appropriate? |
A. | I |
B. | II |
C. | III |
D. | IV |
Answer» E. | |