![]() |
GATE CS 2016 Mock Solutions QUESTION 1: The candidate from our constituency was attacked during his __________ for the MP elections. A) canvas Correct – B QUESTION 2: Which of the following has the closest meaning to the sentence below : She is an __________ writer. Everyone in the industry respects her. A) imminent Correct – C QUESTION 3: Which of the following pairs are not related : A) bold – timid Correct – D QUESTION 4 : Select the most appropriate option that would solve the problem. Problem – What is the profit made by the shopkeeper? A) I alone is sufficient while II alone is not sufficient Correct – C QUESTION 5 : What is the probability of getting atmost two tails when an unbiased coin is tossed thrice? Correct – A (Q6 to Q10 carry 2 marks each) QUESTION 6 : Select the option closest to the meaning of the idiom – Skeleton crew A) A group of stupid people Correct – C QUESTION 7 : For the given statement, select the assumption(s) that follow: A) I follows Correct – A QUESTION 8 : A bag contains 5 balls out of which some or maybe all are black. 2 balls are drawn from the bag and both are found to be black. What is the probability that all balls in the bag are black? Correct – 0.5 Since 2 black balls were drawn, the number of black balls may be either of 2,3,4,5. P(E / A2) = 2C2 / 5C2 = 1/10 Since the number of black balls is unknown, all events A2, A3, A4, A5 are equally likely. P(A5 / E) ={1/4 X 1} / [{1/4 X 1/10}+{1/4 X 3/10}+{1/4 X 3/5}+{1/4 X 1}] P(A5 / E) = 1/2 = 0.5 QUESTION 9 : Answer the question on the basis of the given table. If the number of male post–graduate employees in company H is 1800, what percent of female employees in that particular company is NOT post–graduate? A) 76 Correct – C Number of post graduate employees in company H = 80% of 3360 = 2688 QUESTION 10 : Answer the question on the basis of the given table. Which company has the highest number of employees per office? A) Company F Correct – D F = 2788 / 17 = 164 (Q11 to Q35 carry 1 mark each) QUESTION 11 : Given h(z) = (z+2)2 + 3(z+2) – 8, determine two functions f(z) and g(z) which when composed together as f(g(z)) will generate h(z). A) f(z) = z2 + 3z – 8, g(z) = z Correct – C From option C, f(g(z)) = f(z+2) = (z+2) 2+ 3(z+2) – 8 = h(z) QUESTION 12 : What is the value of limx–>0 (cos x – 1) / x A) e Correct – B There is a property in limits that limx–>0(cos x – 1) / x = 0. QUESTION 13 : Match the best case complexity : (P) Selection Sort (X) O ( n log(n) ) A) P – X, Q – Z, R – Y Correct – B Selection sort has a complexity O ( n2 ) in every case. QUESTION 14 Consider the below Pseudo code written in C style bool fun(int arr[], int n, int X) Which of the following is true about above code. A) Time Complexity of fun() is O(2n) and it requires O(n) extra space Correct – A T(n) = 2 T(n–1) + c, which is O(2n). QUESTION 15 : Consider the below Pseudo code written in C style bool fun(int arr[], int n, int X) Which of the following is true about the function in the above code. A) Returns true if there are two subsequences of arr[] with product as X. Correct – C The function represents code for a variation of subset sum problem. QUESTION 16 : Consider the following tree. How many nodes will have the same position regardless of the fact whether the tree is traversed in DFS or BFS order? (Consider that we select children from right to left starting from the rightmost child) ________ Correct – 3 DFS – ACEFHGBD QUESTION 17 : The following numbers are inserted into an empty binary search tree in the given order: 10, 1, 3, 5, 15, 12, 16, 4, 2. What is the height of the binary search tree? (Here height is defined as number of edges on longest path from root to a leaf) A) 2 Correct – C The height of a binary search tree is the maximum distance of a leaf node from the root. QUESTION 18 : Which of the following is true about the given grammar S –> iCtSE | a (NOTE : Here, ‘eps’ represesnts epsilon) A) The grammar is LL(1) Correct – B FIRST (S) = {i, a} FOLLOW (S) = {$, e} When we make the LL(1) parse table, we get a conflict in E row. QUESTION 19 : Which of the following is equivalent to : (i) Correct – A http://www.csitschools.com/ QUESTION 20 : Which of the following sets will have same number of elements in their power set? A) Set 1, Set 2, Set 4 Correct – D No. of elements in Set 1 = 6. So, No. of elements in the power set of Set 1 = 26= 64 QUESTION 21 : Consider a 4 – bit Johnson Counter initialized to ‘0000’. What is the number of clock cycles required for the counter to reset to ‘0000’? _____ Correct – 8 The Johnson counter resets the input, i.e., reaches the initial input in ‘2n’ clock cycles, where ‘n’ is the number of bits. So, for 4 – bit counter, the counter will reset in 2 X 4 = 8 clock cycles. QUESTION 22 : Consider register reference instructions. Which one of the following is true: A) First 12 bits (0 – 11) specify register operation, last 4 bits (12 – 15) are always 1111 Correct – C In register reference instructions, the first 12 bits (0 – 11) specify the register operation. QUESTION 23 : Which class of ports does the port number 48151 belongs? A) The ‘well – known’ ports Correct – B Port numbers 1 – 1023 belong to the ‘well – known’ ports. QUESTION 24 : Consider the fragment offset field in the IPv4 header. What is its maximum value in bytes ? ____ Correct – 65528 The length of fragment offset field is 13 bits. Also, fragment offset is measured in 8 – byte blocks. So, maximum offset is (213– 1) X 8 = 65528 bytes. QUESTION 25 : Match the protocols with the port numbers. (P) HTTPS (W) 110 A) P – W, Q – Z, R – Y, S – X Correct – D HTTPS – 443 QUESTION 26: Consider below the regular expressions over alphabet {0, 1, 2} (i) (0 + 01 + 012))* Which of the above regular expressions represent same language as 0*(01)*(012)* (A) i, ii and iii Correct – C Making a DFA is all that is required to get the correct answer. QUESTION 27 : Assuming a 16 – bit address space with 12 logical pages. What is the size of each page ? A) 1K Correct – C It takes 4 bits to reference 12 logical pages (24 = 16, so maximum 16 pages can be referenced in 4 – bits). Now, we are left with 16 – 4 = 12 bits, which can be used for pages. QUESTION 28 : What is the output of the following C program : #include “stdio.h” A) –2, 3, 2, 1 Correct – B For calculating ‘m’, any non – zero value is considered TRUE. In conditional operator, ++i makes i = –1, which makes it go to the TRUE case of the conditional operator. Now, ––k will return 0 and since there is AND after that, it will not be calculated any further as False && False or False && True will always return False. QUESTION 29 : Consider a table STUDENTS and the following two SQL queries. Which of the following is TRUE : A) Query 2 will fire any associated triggers whereas Query 1 will not Correct – D Both the queries will remove all the rows from the table. But, query 1 can be undone by using rollback whereas query 2 is permanent. Also, DELETE fires all the associated triggers whereas TRUNCATE does not. QUESTION 30 : What is the sum of all the elements of the L and U matrices as obtained in the L U decomposition? A) 16 Correct – C So, the sum of all elements is 9. QUESTION 31 : What is the output of the following C program : #include “stdio.h” A) 0.000000 * 0.000000 Correct – B Computation for ‘i’ would be done using integer arithmetic whereas for ‘j’, it would be done using double or floating point arithmetic. Also, the precedence of ‘*’ and ‘/’ would be same and the expression would be calculated from Left to Right. QUESTION 32 : Consider following three function written in C style :
Which of the following is true : i) Time Complexity of fun1() is Θ(n3) A) ii, iii and iv Correct – A Time Complexity of fun1() – Θ(log (n3)) = Θ(log n) QUESTION 33 : Consider a network path with three links. A) 54.90 ms Correct – D Total delay = Propagation delay + Transmission Delay + Queuing delay + Processing delay Total delay = 40ms + 10ms + 5ms + 500KB X (1/10Gbps + 1/2Gbps + 1/2Gbps) Total delay = 59.40 ms QUESTION 34: Consider below statements about Heap Data Structure i) Time complexity of making a Min Heap from n unsorted elements is O(n) Which of the above are true? A) Only i, ii, iii and v Correct – C (i) is true (Refer /archive/g-fact-85/) QUESTION 35: Consider below program Line 1 : #include “stdio.h” Which of the following is true about the program: A) Compiler Error in Line 4 Correct – A Comma is used either as a separator or an operator. Here, it is used in line 4 as a separator rather than operator. It should be written as : int a; (Q36 to Q65 carry 2 marks each) QUESTION 36 : Assume CSMA/CD protocol. Find the least frame length in bytes for a 2 Mbps bit rate and 1.5km long network where propagation delay is 4.25 nano seconds per metre. ______ Correct – 3.1875 Minimum frame size for CSMA/CD = 2 X Propagation delay QUESTION 37: Which of the following has the longest range ? A) WiFi : 802.11n Correct – A WiFi : 802.11n has the highest range among the other given choices. QUESTION 38 : Which of the following follow commutative law but not associative law? A) AND Correct – D All gates follow commutative law. QUESTION 39 : Solve upto 2 places after the decimal : ______ Correct – 1.32 On opening the summation, we would be left with (1) + (1/2) – (1/11) – (1/12), which is equal to 175/132. Taking upto 2 places after the decimal, we get 1.32 as our answer. QUESTION 40: Consider a function f(A,B,C,D) defined by the summation of the terms 1, 5, 6, 7, 11, 12, 13, 15. What is the value of function ‘f’ in the SOP form? A) A’ C’ D + A B C’ + A’ B C + A C D Correct – A QUESTION 41: Consider the recurrence relation T(n) = T(n–1) + T(n/2) + n. Which of the following is a good tight upper bound on T(n) (A) Θ(n2) Correct – C http://hscc.cs.nthu.edu.tw/~sheujp/lecture_note/13algorithm/ch4%20solution.pdf QUESTION 42 : WiFi is : A) Simplex Correct – C WiFi is half duplex. QUESTION 43 : Consider the grammar given below: S → AS | b The grammar is : (i) LL(1) (A) (i) & (iii) are correct Correct – D The Grammar is ambiguous. For a string “abab” two derivations are possible and no ambiguous grammar can be LR. QUESTION 44 : Consider the automaton X over the alphabet {x,y,z} Which of the below statements are true about the diagram: (A) i, iii, iv and v Correct – D (i) is false: empty strings can’t be accepted QUESTION 45: Which of the following statements are true? A) S1, S2 Correct – B QUESTION 46 : Consider three processes P1, P2 and P3 arriving at 0ms, 4ms and 10ms respectively and have burst times 8ms, 4ms and 1ms respectively. Which of the following will have the highest average waiting time ? A) First Come First Serve (FCFS) Correct – D Round Robin with time quantum 1 will have the highest average waiting time of 3ms. Rest all will have average waiting time less than 3ms. QUESTION 47 : Consider the following statements : Which of the above are True ? A) Only (I) Correct – C It is possible to design JK flip flop using T flip flop QUESTION 48: Consider an instruction pipeline with four stages (S1, S2, S3 and S4) each with combinational circuit only. The pipeline registers are required between each stage and at the end of the last stage. Delays for the stages and for the pipeline registers are as given in the figure: What is the approximate speed up of the pipeline in steady state under ideal conditions when compared to the corresponding non-pipeline implementation? _____________ Correct – 2.25 Time without pipeline = 8 + 1 + 12 + 15 ns = 36 ns QUESTION 49 : Assume two relations R1(X, Y ) with Primary key Y and 1000 tuples and R2( Y,Z ) with primary key YZ and 2000 tuples and it is given that R2. Y is foreign key to R1.Y What will be maximum and minimum number of tuples in natural join of R and S? A) Max 2000 and Min 1000 Correct – C QUESTION 50 : Select the option that will give highest number of page faults for the sequence – 7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2, 1, 2, 0, 1, 7, 0, 1. A) Optimal Page Replacement Algorithm with 3 frames Correct – B Optimal Page Replacement Algorithm with 3 frames – 9 page faults QUESTION 51 : Solve : Round off the answer to the nearest integer. ______ Correct – 3 QUESTION 52: What is mod(product of eigen values) for the matrix : 1 2 -2 Correct – 4 Th eigen values of the matrix are 1, 2 and -2, the product of which is -4. QUESTION 53: Consider the following query on a relation REL(X,Y,Z) with candidate keys X and Y. Q1: select count(*) from (select X,Y from REL)R1 NATURAL JOIN (select Y,Z from REL)R2; The result of which queries will be equivalent ? A) Q1, Q2 Correct – A QUESTION 54 : Predict the output of the C program: #include “stdio.h” If there is compile error, your answer should be 99. Correct – 123 Inside fun(), q is a copy of the pointer p. So if we change q to point something else then p remains unaffected. QUESTION 55 : Consider a Binary Tree where the allowed height difference between left and right children of every node is at most one. What are the maximum and minimum possible heights of such a Binary Tree ? (A) Minimum Height : floor (log n) and Maximum Height : approximately 1.44 log n Correct – A The binary tree as per the question would be an AVL Tree. QUESTION 56: What is the solution of the following recurrence relation : T(n) = T(n/4) + T(n/2) + n3 A) O (n4) Correct – B We can solve it by drawing a recursion tree similar to /archive/algorithms-analysis-of-algorithms-question-1/ QUESTION 57: Consider a system generating 20 bit frames and connected through a shared 20kbps channel. Find throughput in percent if slotted ALOHA is used and frame rate is 1000 fps. Your answer should be rounded off to the nearest integer. ________________ Correct – 37 Frame size = L = 20 bits QUESTION 58: Consider a graph with ‘n’ nodes such that 1 node is master node and all other are slave nodes such that the master is connected to all slaves but no two slaves are connected. What is the chromatic number for such graph? A) n Correct – D Lets say that we give color RED to master. Since slaves are connected to the master, no slave can be given RED color but since all of them are mutually unconnected, they all can be given same color, say GREEN. So, we need only two colors. QUESTION 59: Match the correct choices : (P) Array (W) Average case access – O(n) A) P – W, Q – X, R – Y, S – Z Correct – C QUESTION 60: In the Lexical Analysis, regular expression can be used to model A) the structures of lexemes with fixed length identifier excluded Correct – D The structure of all lexemes(of any length) in the program can be verified & described by a Regular Grammar, and a Regular Grammar can be described using a Regular Expression. QUESTION 61: Match the correct choices : (P) Transport Layer (W) IP Address A) P – W, Q – X, R – Y Correct – C QUESTION 62: A relation R has no composite candidate keys. Which of the following is always true for relation R? (A) R is in 2NF Correct – A A relation without composite keys will always satisfy the conditions for a relation to be in 2NF. QUESTION 63: Consider a frame 1101011011 and a generator polynomial 10011. What is the number of 1’s in the transmitted frame? ________ Correct – 10 So, the number of 1’s in the transmitted frame is 10. QUESTION 64 : Consider a symmetric key cryptography system with 15 users. What is the number of keys required for this system? ________ Correct – 105 Number of keys = (15 X 14) / 2 = 105 QUESTION 65: Consider following forwarding table in router An incoming packet with IP address 201.10.7.17 is forwarded to outgoing link : A) 3 Correct – B Routers use Longest Prefix Matching rule. The rule is to find the entry in table which has the longest prefix matching with incoming packet’s destination IP, and forward the packet to corresponding next hop. http://inst.eecs.berkeley.edu/~ee122/fa09/notes/08-Forwarding-Transportx6.pdf Results of GATE CS 2016 Mock TestPlease write comments if you find anything incorrect, or you want to share more information about the topic discussed above |
Reffered: https://www.geeksforgeeks.org
GATE CS |
Related |
---|
![]() |
![]() |
![]() |
![]() |
![]() |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 14 |