GATE 2017 CS (CS2) – Previous Year Questions with Solutions
All 65 questions of GATE 2017 CS (CS2) with answers and explanations. Read each question, then practise it by topic or as a full paper.
Practise this paper in The GATE Grind →
- Question 1 – Choose the pair of words that are NOT synonyms.
- Question 2 – Saturn is to be seen on a clear night with the naked eye.
- Question 3 – Five buildings V,W,X,Y,Z stand in a row. V is west of W. Z is east of X and west of V. W is west of Y. Which building is in the middle?
- Question 4 – A test has twenty questions worth 100 marks in total. Multiple-choice questions carry 3 marks each and essay questions 11 marks each. How many…
- Question 5 – There are 3 red socks, 4 green socks and 3 blue socks. Choose two socks uniformly without replacement. What is the probability they have the same…
- Question 6 – “We lived in a culture that denied any merit to literary works, considering them important only when they were handmaidens to something seemingly more…
- Question 7 – Three boxes contain apples only, oranges only, and both apples and oranges. All three labels are incorrect. You may open just one box and inspect one…
- Question 8 – X is a 30-digit positive integer starting with digits 4 then 7. How many digits does X³ have?
- Question 9 – How many roots does ex+0.5x2-2=0 have in [−5,5]?
- Question 10 – An air-pressure contour joins locations of equal atmospheric pressure. The shown contours occur at 0.05 bar intervals. Thunderstorm possibility…
- Question 11 – The hexadecimal representation of a 16-bit unsigned integer X is BCA9. Find its octal representation.
- Question 12 – Match (P) static char var; (Q) m = malloc(10); m = NULL; (R) char *ptr[10]; (S) register int var1; with (i) sequence of memory locations storing…
- Question 13 – Match (P) Towers of Hanoi with n disks, (Q) binary search on n sorted numbers, (R) worst-case heap sort on n numbers, (S) addition of two n×n…
- Question 14 – L₁,L₂ are context-free and R is regular. Which are correct? I: L₁∪L₂ is context-free. II: L 1 is context-free. III: L₁−R is context-free. IV: L₁∩L₂ is…
- Question 15 – Match compiler inputs P: syntax tree, Q: character stream, R: intermediate representation, S: token stream, to phases (i) code generator, (ii) syntax…
- Question 16 – Which parser statements are correct? I: Canonical LR is more powerful than SLR. II: SLR is more powerful than LALR. III: SLR is more powerful than…
- Question 17 – Which are shared by all threads of one process? I: Program counter. II: Stack. III: Address space. IV: Registers.
- Question 18 – Which file-allocation schemes can be used when external fragmentation is not allowed? I: Contiguous. II: Linked. III: Indexed.
- Question 19 – For RIP and OSPF in IPv4: I: RIP uses distance-vector routing. II: RIP packets use UDP. III: OSPF packets use TCP. IV: OSPF uses link-state routing.…
- Question 20 – f(x)=R( x/2)+S, f(1/2)=2 and 01 f(x)dx=2R/. Find R,S respectively.
- Question 21 – Let p,q,r mean “It is raining”, “It is cold”, “It is pleasant”. Represent: “It is not raining and it is pleasant, and it is not pleasant only if it is…
- Question 22 – A 32-bit IEEE-754 single-precision bit pattern is 00111110011011010000000000000000. Which decimal value is closest?
- Question 23 – A circular queue uses a singly linked list, with value and next-pointer per node and exactly two external pointers FRONT and REAR. For O(1) insertion…
- Question 24 – What is printed by printxy(1,1)?
- Question 25 – BFS is implemented using a queue. Which is a possible vertex-visiting order for the shown graph?
- Question 26 – With start S and rules S→XY, X→aX a, Y→aYb ε, identify the language.
- Question 27 – Entity types A and B are connected by relationship R with no attributes. When can the relation table for R be merged with A’s table?
- Question 28 – Linux supports connected UDP sockets, on which connect has already been called. Which hold? I: One connected UDP socket communicates with multiple…
- Question 29 – Tables T₁(P,Q) = (2,2),(3,8),(7,3),(5,8),(6,9),(8,5),(9,8) and T₂(R,S) = (2,2),(8,3),(3,2),(9,7),(5,7),(7,2). P and R are primary keys. T₁.Q…
- Question 30 – What is the largest number of IPv4 router addresses that fit in the record-route option of an IPv4 header?
- Question 31 – X=a,b,c,d,e has partial order R=(a,a),(a,b),(a,c),(a,d),(a,e),(b,b),(b,c),(b,e),(c,c),(c,e),(d,d),(d,e),(e,e), with Hasse diagram shown. How many…
- Question 32 – Let P=pmatrix1&1&-1\\2&-3&4\\3&-2&3pmatrix, Q=pmatrix-1&-2&-1\\6&12&6\\5&10&5pmatrix. Find rank(P+Q).
- Question 33 – An undirected graph has n vertices, 25 edges and every vertex has degree at least three. Find the greatest possible n.
- Question 34 – The equation x²−13x+36=0 has coefficients written in base b, and its roots in the same base are x=5 and x=6. Find b.
- Question 35 – Find the minimum number of DFA states for L=\w 1aw 2:w 1,w 2\a,b\*,\ w 1 =2,\ w 2 3\.
- Question 36 – P applies for a job with probability 1/4. P(P applies Q applies)=1/2 and P(Q applies P applies)=1/3. Find P(P does not apply Q does not apply).
- Question 37 – For Boolean variables w,x,y,z, which identity is INCORRECT?
- Question 38 – f(w,x,y,z)= m(0,1,2,3,7,8,10)+ d(5,6,11,15), with d denoting Karnaugh-map don’t-cares. Find a minimum product of sums.
- Question 39 – L₁ and L₂ cache access times are 1 and 8 cycles. L₂-to-main-memory miss penalty is 18 cycles. L₁ miss rate is twice L₂ miss rate. AMAT is 2 cycles.…
- Question 40 – T(n)=2T( n)+1 for n>2, and T(n)=2 for 0<n≤2. Find its asymptotic order.
- Question 41 – For a discrete X with P(X=j)=pⱼ, pⱼ≥0, j=0,…,N and Σpⱼ=1, define g X(z)= j=0Np jzj. A variable Y has g Y(z)=(1-+ z)N, 0≤β≤1. Find E[Y].
- Question 42 – G has E→E−T T, T→T+F F, F→(E) id. Which equivalent grammar has no left recursion?
- Question 43 – Nine tape drives are shared. For P₁,P₂,P₃, current allocations are 3,1,3 and maximum requirements are 7,6,5. Describe the system state.
- Question 44 – A binary code has exactly four valid words: 00000,01011,10101,11110. Let p be minimum Hamming distance and q maximum correctable bit errors. Find p,q.
- Question 45 – Hosts X,Y have a direct 10⁶ bit/s link, distance 10000 km, propagation speed 2×10⁸ m/s. X sends a 50000-byte file as one continuous message. Find…
- Question 46 – BST preorder is 12,8,6,2,7,9,10,16,15,19,17,20. Find its postorder.
- Question 47 – The following fragment divides x by y using repeated subtraction. All variables x,y,q,r are unsigned int. Which precondition ensures termination with…
- Question 48 – Find the time complexity.
- Question 49 – An ε-NFA has start q₀. Transition triples (ε,a,b) are q₀:(q₂,q₁,q₀); q₁:(q₂,q₂,q₃); q₂:(q₀,∅,∅); q₃:(∅,∅,q₂). Find the extended transition δ̂(q₂,aba).
- Question 50 – L₁=aᵖ:p prime, L 2=\anbmc2m:n,m0\, L 3=\anbnc2n:n0\, L₄=aⁿbⁿ:n≥1. Which hold? I: L₁ context-free but not regular. II: L₂ not context-free. III: L₃ not…
- Question 51 – L(R) is a regular-expression language, L(G) a context-free grammar language, L(M) a Turing-machine language. Which are undecidable? I: Given R,w, is…
- Question 52 – A synchronous two-bit saturating up-counter has transitions 00→01,01→10,10→11,11→11. With T flip-flops, find T₁,T₀.
- Question 53 – swap exchanges its two arguments. Find the output.
- Question 54 – Transactions are T₁:r₁(X)w₁(X)r₁(Y)w₁(Y) and T₂:r₂(Y)w₂(Y)r₂(Z)w₂(Z). How many interleavings preserve each transaction’s order and are…
- Question 55 – I-cache has (read time 2 ns, hit ratio 0.8), D-cache (2 ns,0.9), L₂-cache (8 ns,0.9). Main-memory read is 90 ns. Caches are direct-mapped,…
- Question 56 – top scorer(player,country,goals) contains Klose/Germany/16, Ronaldo/Brazil/15, G Müller/Germany/14, Fontaine/France/13, Pelé/Brazil/12,…
- Question 57 – The ordinary generating function of aₙ is (1+z)/(1-z)3. Find a₃−a₀.
- Question 58 – X is Poisson with mean 5. Find E[(X+2)²].
- Question 59 – A B+ tree has eight-byte search keys, 512-byte blocks and two-byte block pointers. Find its maximum order.
- Question 60 – Characters P,Q,R,S,T have probabilities 0.22,0.34,0.17,0.19,0.08. A 100-character message is Huffman encoded. Find its expected encoded length in…
- Question 61 – Processes P₁,…,P₅ have (arrival ms, CPU burst ms, priority): (0,11,2),(5,28,0),(12,2,3),(2,10,1),(9,16,4). Priority 0 is highest; none has I/O. Find…
- Question 62 – A real 3×3 matrix has characteristic polynomial 3-42+a+30 and one eigenvalue 2. Find the largest absolute eigenvalue.
- Question 63 – A byte-addressable main memory has 2³² bytes, divided into 32-byte blocks. A direct-mapped cache has 512 lines. Find tag-field size in bits.
- Question 64 – Find the C program output.
- Question 65 – Find the C program output.