GATE 2015 CS (Set 2)

All 65 questions of GATE 2015 CS (Set 2)

Question text and figures as in the official paper, with the answer from the official key. Worked solutions for every question are in your report after you take the paper as a 3-hour test.

Q1 · General Aptitude · MCQ · 1 mark

We __________ our friend's birthday and we __________ how to make it up to him.

  • (A)
    completely forgot --- don't just know
  • (B)
    forgot completely --- don't just know
  • (C)
    completely forgot --- just don't know
  • (D)
    forgot completely --- just don't know

Answer (official key): C

Worked solution: in your report after you take this paper.

Q2 · General Aptitude · MCQ · 1 mark

Choose the statement where the underlined word is used correctly.

  • (A)
    The industrialist had a personnel jet.
  • (B)
    I write my experience in my personnel diary.
  • (C)
    All personnel are being given the day off.
  • (D)
    Being religious is a personnel aspect.

Answer (official key): C

Worked solution: in your report after you take this paper.

Q3 · General Aptitude · MCQ · 1 mark

Consider a function

f(x)=1−∣x∣f(x)=1-|x|

on

−1≤x≤1.-1 \le x \le 1.

The value of xx at which the function attains a maximum, and the maximum value of the function are:

  • (A)
    0,−10,-1
  • (B)
    −1,0-1,0
  • (C)
    0,10,1
  • (D)
    −1,2-1,2

Answer (official key): C

Worked solution: in your report after you take this paper.

Q4 · General Aptitude · MCQ · 1 mark

A generic term that includes various items of clothing such as a skirt, a pair of trousers and a shirt is:

  • (A)
    fabric
  • (B)
    textile
  • (C)
    fibre
  • (D)
    apparel

Answer (official key): D

Worked solution: in your report after you take this paper.

Q5 · General Aptitude · MCQ · 1 mark

Based on the given statements, select the most appropriate option to solve the given question.

What will be the total weight of 10 poles each of same weight?

Statements:

I. One fourth of the weight of a pole is 5 kg.
II. The total weight of these poles is 160 kg more than the total weight of two poles.

  • (A)
    Statement I alone is not sufficient.
  • (B)
    Statement II alone is not sufficient.
  • (C)
    Either I or II alone is sufficient.
  • (D)
    Both statements I and II together are not sufficient.

Answer (official key): C

Read the worked solution

Q6 · General Aptitude · MCQ · 2 marks

Out of the following four sentences, select the most suitable sentence with respect to grammar and usage.

  • (A)
    Since the report lacked needed information, it was of no use to them.
  • (B)
    The report was useless to them because there were no needed information in it.
  • (C)
    Since the report did not contain the needed information, it was not real useful to them.
  • (D)
    Since the report lacked needed information, it would not had been useful to them.

Answer (official key): A

Read the worked solution

Q7 · General Aptitude · MCQ · 2 marks

If the list of numbers P,R,S,T,UP,R,S,T,U is an arithmetic sequence, which of the following are also in arithmetic sequence?

I. 2P,2R,2S,2T,2U2P,2R,2S,2T,2U
II. P−3,R−3,S−3,T−3,U−3P-3,R-3,S-3,T-3,U-3
III. P2,R2,S2,T2,U2P^2,R^2,S^2,T^2,U^2

  • (A)
    I only
  • (B)
    I and II
  • (C)
    II and III
  • (D)
    I and III

Answer (official key): B

Worked solution: in your report after you take this paper.

Q8 · General Aptitude · MCQ · 2 marks

Four branches of a company are located at M,N,OM,N,O, and PP.

MM is north of NN at a distance of 4 km.
PP is south of OO at a distance of 2 km.
NN is southeast of OO by 1 km.

What is the distance between MM and PP in km?

  • (A)
    5.34
  • (B)
    6.74
  • (C)
    28.5
  • (D)
    45.49

Answer (official key): A

Worked solution: in your report after you take this paper.

Q9 · General Aptitude · Numerical · 2 marks

If p,q,r,sp,q,r,s are distinct integers such that:

f(p,q,r,s)=max⁡(p,q,r,s)f(p,q,r,s)=\max(p,q,r,s) g(p,q,r,s)=min⁡(p,q,r,s)g(p,q,r,s)=\min(p,q,r,s) h(p,q,r,s)={remainder of p×qr×s,if p×q>r×sremainder of r×sp×q,if r×s>p×qh(p,q,r,s)= \begin{cases} \text{remainder of } \frac{p\times q}{r\times s}, & \text{if } p\times q > r\times s \\ \text{remainder of } \frac{r\times s}{p\times q}, & \text{if } r\times s > p\times q \end{cases}

Also, a function

fgh(p,q,r,s)=f(p,q,r,s)×g(p,q,r,s)×h(p,q,r,s).fgh(p,q,r,s)=f(p,q,r,s)\times g(p,q,r,s)\times h(p,q,r,s).

The same operations are valid with two-variable functions of the form f(p,q)f(p,q).

What is the value of

fg(h(2,5,7,3),4,6,8)?fg(h(2,5,7,3),4,6,8)?

Answer (official key): 8

Worked solution: in your report after you take this paper.

Q10 · General Aptitude · MCQ · 2 marks

In a triangle PQRPQR, PSPS is the angle bisector of ∠QPR\angle QPR and ∠QPS=60∘\angle QPS=60^\circ. What is the length of PSPS?

Triangle diagram for Q7

  • (A)
    q+rqr\frac{q+r}{qr}
  • (B)
    qrq+r\frac{qr}{q+r}
  • (C)
    q2+r2\sqrt{q^2+r^2}
  • (D)
    (q+r)2qr\frac{(q+r)^2}{qr}

Answer (official key): B

Worked solution: in your report after you take this paper.

Q11 · Compiler Design · MCQ · 1 mark

In the context of abstract-syntax-tree (AST) and control-flow-graph (CFG), which one of the following is TRUE?

  • (A)
    In both AST and CFG, if node N2N_2 is the successor of node N1N_1 in the input program, the code corresponding to N2N_2 is present after the code corresponding to N1N_1.
  • (B)
    For any input program, neither AST nor CFG will contain a cycle.
  • (C)
    The maximum number of successors of a node in an AST and a CFG depends on the input program.
  • (D)
    Each node in AST and CFG corresponds to at most one statement in the input program.

Answer (official key): C

Worked solution: in your report after you take this paper.

Q12 · Computer Networks · MCQ · 1 mark

Identify the correct order in which a server process must invoke the function calls accept, bind, listen, and recv according to UNIX socket API.

  • (A)
    listen, accept, bind, recv
  • (B)
    bind, listen, accept, recv
  • (C)
    bind, accept, listen, recv
  • (D)
    accept, listen, bind, recv

Answer (official key): B

Worked solution: in your report after you take this paper.

Q13 · Linear Algebra · Numerical · 1 mark

The larger of the two eigenvalues of the matrix

[4521]\begin{bmatrix} 4 & 5\\ 2 & 1 \end{bmatrix}

is __________.

Answer (official key): 6

Worked solution: in your report after you take this paper.

Q14 · Discrete Mathematics · Numerical · 1 mark

The cardinality of the power set of

{0,1,2,…,10}\{0,1,2,\ldots,10\}

is __________.

Answer (official key): 2048

Worked solution: in your report after you take this paper.

Q15 · Discrete Mathematics · MCQ · 1 mark

Consider the following two statements.

S1: If a candidate is known to be corrupt, then he will not be elected.S_1: \text{ If a candidate is known to be corrupt, then he will not be elected.} S2: If a candidate is kind, he will be elected.S_2: \text{ If a candidate is kind, he will be elected.}

Which one of the following statements follows from S1S_1 and S2S_2 as per sound inference rules of logic?

  • (A)
    If a person is known to be corrupt, he is kind.
  • (B)
    If a person is not known to be corrupt, he is not kind.
  • (C)
    If a person is kind, he is not known to be corrupt.
  • (D)
    If a person is not kind, he is not known to be corrupt.

Answer (official key): C

Worked solution: in your report after you take this paper.

Q16 · Programming and Data Structures · Numerical · 1 mark

A binary tree TT has 20 leaves.

The number of nodes in TT having two children is __________.

Answer (official key): 19

Worked solution: in your report after you take this paper.

Q17 · Discrete Mathematics · Numerical · 1 mark

The number of divisors of 2100 is __________.

Answer (official key): 36

Worked solution: in your report after you take this paper.

Q18 · Computer Networks · Numerical · 1 mark

A link has a transmission speed of 10610^6 bits/sec.

It uses data packets of size 1000 bytes each.

Assume that the acknowledgement has negligible transmission delay, and that its propagation delay is the same as the data propagation delay.

Also assume that the processing delays at nodes are negligible.

The efficiency of the stop-and-wait protocol in this setup is exactly 25%.

The value of the one-way propagation delay in milliseconds is __________.

Answer (official key): 12

Worked solution: in your report after you take this paper.

Q19 · Operating System · MCQ · 1 mark

A system has 6 identical resources and NN processes competing for them.

Each process can request at most 2 resources.

Which one of the following values of NN could lead to a deadlock?

  • (A)
    1
  • (B)
    2
  • (C)
    3
  • (D)
    4

Answer (official key): D

Worked solution: in your report after you take this paper.

Q20 · Compiler Design · MCQ · 1 mark

Match the following.

ItemConcept
P. Lexical analysis1. Graph coloring
Q. Parsing2. DFA minimization
R. Register allocation3. Post-order traversal
S. Expression evaluation4. Parse-tree traversal
  • (A)
    P-2, Q-3, R-1, S-4
  • (B)
    P-2, Q-1, R-4, S-3
  • (C)
    P-2, Q-4, R-1, S-3
  • (D)
    P-2, Q-3, R-4, S-1

Answer (official key): C

Worked solution: in your report after you take this paper.

Q21 · Programming and Data Structures · MCQ · 1 mark

A software requirements specification (SRS) document should avoid discussing which one of the following?

  • (A)
    User interface issues
  • (B)
    Non-functional requirements
  • (C)
    Design specification
  • (D)
    Interfaces with third party software

Answer (official key): C

Worked solution: in your report after you take this paper.

Q22 · Databases · Numerical · 1 mark

With reference to the B+ tree index of order 1 shown below, the minimum number of nodes, including the root node, that must be fetched in order to satisfy the following query is __________.

Query: Get all records with a search key greater than or equal to 7 and less than 15.

B+ tree for Q32

Answer (official key): 5

Read the worked solution

Q23 · Programming and Data Structures · Numerical · 1 mark

Consider the following C function.

int fun(int n) {
    int x = 1, k;

    if (n == 1)
        return x;

    for (k = 1; k < n; ++k)
        x = x + fun(k) * fun(n - k);

    return x;
}

The return value of fun(5) is __________.

Answer (official key): 51

Worked solution: in your report after you take this paper.

Q24 · Theory of Computation · MCQ · 1 mark

Consider the following statements.

I. The complement of every Turing decidable language is Turing decidable.
II. There exists some language which is in NP but is not Turing decidable.
III. If LL is a language in NP, LL is Turing decidable.

Which of the above statements is/are true?

  • (A)
    Only II
  • (B)
    Only III
  • (C)
    Only I and II
  • (D)
    Only I and III

Answer (official key): D

Worked solution: in your report after you take this paper.

Q25 · Theory of Computation · MCQ · 1 mark

Consider two decision problems Q1,Q2Q_1,Q_2 such that Q1Q_1 reduces in polynomial time to 3-SAT and 3-SAT reduces in polynomial time to Q2Q_2.

Then which one of the following is consistent with the above statement?

  • (A)
    Q1Q_1 is in NP, Q2Q_2 is NP-hard.
  • (B)
    Q2Q_2 is in NP, Q1Q_1 is NP-hard.
  • (C)
    Both Q1Q_1 and Q2Q_2 are in NP.
  • (D)
    Both Q1Q_1 and Q2Q_2 are NP-hard.

Answer (official key): A

Worked solution: in your report after you take this paper.

Q26 · Digital Logic · Numerical · 1 mark

The minimum number of JK flip-flops required to construct a synchronous counter with the count sequence

0,0,1,1,2,3,3,0,0,…0,0,1,1,2,3,3,0,0,\ldots

is __________.

Answer (official key): 3

Worked solution: in your report after you take this paper.

Q27 · Computer Networks · MCQ · 1 mark

Which one of the following statements is NOT correct about HTTP cookies?

  • (A)
    A cookie is a piece of code that has the potential to compromise the security of an Internet user.
  • (B)
    A cookie gains entry to the user's work area through an HTTP header.
  • (C)
    A cookie has an expiry date and time.
  • (D)
    Cookies can be used to track the browsing pattern of a user at a particular site.

Answer (official key): A

Worked solution: in your report after you take this paper.

Q28 · Programming and Data Structures · MCQ · 1 mark

Consider the following function written in the C programming language.

void foo(char *a) {
    if (*a && *a != ' ') {
        foo(a + 1);
        putchar(*a);
    }
}

The output of the above function on input "ABCD EFGH" is:

  • (A)
    ABCD EFGH
  • (B)
    ABCD
  • (C)
    HGFE DCBA
  • (D)
    DCBA

Answer (official key): D

Worked solution: in your report after you take this paper.

Q29 · Computer Organization and Architecture · Numerical · 1 mark

Assume that for a certain processor, a read request takes 50 nanoseconds on a cache miss and 5 nanoseconds on a cache hit.

Suppose while running a program, it was observed that 80% of the processor's read requests result in a cache hit.

The average read access time in nanoseconds is __________.

Answer (official key): 14

Worked solution: in your report after you take this paper.

Q30 · Databases · MCQ · 1 mark

Consider the following transaction involving two bank accounts xx and yy.

read(x);
x := x - 50;
write(x);
read(y);
y := y + 50;
write(y);

The constraint that the sum of the accounts xx and yy should remain constant is that of:

  • (A)
    Atomicity
  • (B)
    Consistency
  • (C)
    Isolation
  • (D)
    Durability

Answer (official key): B

Worked solution: in your report after you take this paper.

Q31 · Computer Organization and Architecture · Numerical · 1 mark

A computer system implements a 40-bit virtual address, page size of 8 kilobytes, and a 128-entry translation look-aside buffer (TLB) organized into 32 sets each having four ways.

Assume that the TLB tag does not store any process id.

The minimum length of the TLB tag in bits is __________.

Answer (official key): 22

Worked solution: in your report after you take this paper.

Q32 · Programming and Data Structures · MCQ · 1 mark

An unordered list contains nn distinct elements.

The number of comparisons to find an element in this list that is neither maximum nor minimum is:

  • (A)
    Θ(nlog⁡n)\Theta(n\log n)
  • (B)
    Θ(n)\Theta(n)
  • (C)
    Θ(log⁡n)\Theta(\log n)
  • (D)
    Θ(1)\Theta(1)

Answer (official key): D

Worked solution: in your report after you take this paper.

Q33 · Programming and Data Structures · MCQ · 1 mark

Consider a complete binary tree where the left and the right subtrees of the root are max-heaps.

The lower bound for the number of operations to convert the tree to a heap is:

  • (A)
    Ω(log⁡n)\Omega(\log n)
  • (B)
    Ω(n)\Omega(n)
  • (C)
    Ω(nlog⁡n)\Omega(n\log n)
  • (D)
    Ω(n2)\Omega(n^2)

Answer (official key): A

Worked solution: in your report after you take this paper.

Q34 · Programming and Data Structures · MCQ · 1 mark

Consider the basic COCOMO model where EE is the effort applied in person-months, DD is the development time in chronological months, KLOCKLOC is the estimated number of delivered lines of code in thousands, and ab,bb,cb,dba_b,b_b,c_b,d_b have their usual meanings.

The basic COCOMO equations are of the form:

  • (A)
    E=ab(KLOC)bb,D=cb(E)dbE=a_b(KLOC)^{b_b},\quad D=c_b(E)^{d_b}
  • (B)
    D=ab(KLOC)bb,E=cb(D)dbD=a_b(KLOC)^{b_b},\quad E=c_b(D)^{d_b}
  • (C)
    E=abbb,D=cb(KLOC)dbE=a_b^{b_b},\quad D=c_b(KLOC)^{d_b}
  • (D)
    E=abdb,D=cb(KLOC)bbE=a_b^{d_b},\quad D=c_b(KLOC)^{b_b}

Answer (official key): A

Worked solution: in your report after you take this paper.

Q35 · Discrete Mathematics · MCQ · 1 mark

Let RR be the relation on the set of positive integers such that aRbaRb if and only if aa and bb are distinct and have a common divisor other than 1.

Which one of the following statements about RR is true?

  • (A)
    RR is symmetric and reflexive but not transitive.
  • (B)
    RR is reflexive but not symmetric and not transitive.
  • (C)
    RR is transitive but not reflexive and not symmetric.
  • (D)
    RR is symmetric but not reflexive and not transitive.

Answer (official key): D

Worked solution: in your report after you take this paper.

Q36 · Theory of Computation · Numerical · 2 marks

The number of states in the minimal deterministic finite automaton corresponding to the regular expression

(0+1)∗(10)(0+1)^*(10)

is __________.

Answer (official key): 3

Worked solution: in your report after you take this paper.

Q37 · Operating System · Numerical · 2 marks

A computer system implements 8 kilobyte pages and a 32-bit physical address space.

Each page table entry contains a valid bit, a dirty bit, three permission bits, and the translation.

If the maximum size of the page table of a process is 24 megabytes, the length of the virtual address supported by the system is __________ bits.

Answer (official key): 36

Worked solution: in your report after you take this paper.

Q38 · Operating System · Numerical · 2 marks

Not in GATE 2027 syllabus: Secondary storage (magnetic disk)

Consider a typical disk that rotates at 15000 rotations per minute (RPM) and has a transfer rate of

50×10650\times10^6

bytes/sec.

If the average seek time of the disk is twice the average rotational delay and the controller's transfer time is 10 times the disk transfer time, the average time, in milliseconds, to read or write a 512-byte sector of the disk is __________.

Answer (official key): 6.1 to 6.2

Worked solution: in your report after you take this paper.

Q39 · Computer Networks · MCQ · 2 marks

Host A sends a UDP datagram containing 8880 bytes of user data to host B over an Ethernet LAN.

Ethernet frames may carry data up to 1500 bytes, i.e. MTU = 1500 bytes.

Size of UDP header is 8 bytes and size of IP header is 20 bytes. There is no option field in IP header.

How many total number of IP fragments will be transmitted and what will be the contents of offset field in the last fragment?

  • (A)
    6 and 925
  • (B)
    6 and 7400
  • (C)
    7 and 1110
  • (D)
    7 and 8880

Answer (official key): C

Worked solution: in your report after you take this paper.

Q40 · Compiler Design · MCQ · 2 marks

Consider the intermediate code given below.

(1)  i = 1
(2)  j = 1
(3)  t1 = 5 * i
(4)  t2 = t1 + j
(5)  t3 = 4 * t2
(6)  t4 = t3
(7)  a[t4] = -1
(8)  j = j + 1
(9)  if j <= 5 goto (3)
(10) i = i + 1
(11) if i < 5 goto (2)

The number of nodes and edges in the control-flow graph constructed for the above code, respectively, are:

  • (A)
    5 and 7
  • (B)
    6 and 7
  • (C)
    5 and 5
  • (D)
    7 and 8

Answer (official key): B

Worked solution: in your report after you take this paper.

Q41 · Theory of Computation · MCQ · 2 marks

Which of the following languages is/are regular?

L1={wxwR∣w,x∈{a,b}∗ and ∣w∣,∣x∣>0},L_1=\{w x w^R \mid w,x\in\{a,b\}^* \text{ and } |w|,|x|>0\},

where wRw^R is the reverse of string ww.

L2={anbm∣m≠n and m,n≥0}L_2=\{a^n b^m \mid m\ne n \text{ and } m,n\ge0\} L3={apbqcr∣p,q,r≥0}L_3=\{a^p b^q c^r \mid p,q,r\ge0\}
  • (A)
    L1L_1 and L3L_3 only
  • (B)
    L2L_2 only
  • (C)
    L2L_2 and L3L_3 only
  • (D)
    L3L_3 only

Answer (official key): A

Worked solution: in your report after you take this paper.

Q42 · Computer Networks · MCQ · 2 marks

Assume that the bandwidth for a TCP connection is 1048560 bits/sec.

Let α\alpha be the value of RTT in milliseconds, rounded off to the nearest integer, after which the TCP window scale option is needed.

Let β\beta be the maximum possible window size with window scale option.

Then the values of α\alpha and β\beta are:

  • (A)
    63 milliseconds, 65535×21465535\times2^{14}
  • (B)
    63 milliseconds, 65535×21665535\times2^{16}
  • (C)
    500 milliseconds, 65535×21465535\times2^{14}
  • (D)
    500 milliseconds, 65535×21665535\times2^{16}

Answer (official key): C

Worked solution: in your report after you take this paper.

Q43 · Databases · MCQ · 2 marks

Consider a simple checkpointing protocol and the following set of operations in the log.

(start, T4);
(write, T4, y, 2, 3);
(start, T1);
(commit, T4);
(write, T1, z, 5, 7);
(checkpoint);
(start, T2);
(write, T2, x, 1, 9);
(commit, T2);
(start, T3);
(write, T3, z, 7, 2);

If a crash happens now and the system tries to recover using both undo and redo operations, what are the contents of the undo list and the redo list?

  • (A)
    Undo: T3, T1; Redo: T2
  • (B)
    Undo: T3, T1; Redo: T2, T4
  • (C)
    Undo: none; Redo: T2, T4, T3, T1
  • (D)
    Undo: T3, T1, T4; Redo: T2

Answer (official key): A

Worked solution: in your report after you take this paper.

Q44 · Programming and Data Structures · Numerical · 2 marks

A Young tableau is a 2D array of integers increasing from left to right and from top to bottom.

Any unfilled entries are marked with ∞\infty, and hence there cannot be any entry to the right of, or below, an ∞\infty.

The following Young tableau consists of unique entries.

12514
34623
10121825
31∞\infty∞\infty∞\infty

When an element is removed from a Young tableau, other elements should be moved into its place so that the resulting table is still a Young tableau.

The minimum number of entries, other than 1, to be shifted to remove 1 from the given Young tableau is __________.

Answer (official key): 5

Read the worked solution

Q45 · Databases · MCQ · 2 marks

Consider two relations R1(A,B)R_1(A,B) with tuples (1,5),(3,7)(1,5),(3,7) and R2(A,C)=(1,7),(4,9)R_2(A,C)=(1,7),(4,9).

Assume that R(A,B,C)R(A,B,C) is the full natural outer join of R1R_1 and R2R_2.

Consider the following tuples of the form (A,B,C)(A,B,C):

a=(1,5,null),b=(1,null,7),c=(3,null,9),a=(1,5,null),\quad b=(1,null,7),\quad c=(3,null,9), d=(4,7,null),e=(1,5,7),f=(3,7,null),g=(4,null,9).d=(4,7,null),\quad e=(1,5,7),\quad f=(3,7,null),\quad g=(4,null,9).

Which one of the following statements is correct?

  • (A)
    RR contains a,b,e,f,ga,b,e,f,g but not c,dc,d.
  • (B)
    RR contains all of a,b,c,d,e,f,ga,b,c,d,e,f,g.
  • (C)
    RR contains e,f,ge,f,g but not a,ba,b.
  • (D)
    RR contains ee but not f,gf,g.

Answer (official key): C

Read the worked solution

Q46 · Computer Networks · MCQ · 2 marks

Consider the following routing table at an IP router.

Network No.Net MaskNext Hop
128.96.170.0255.255.254.0Interface 0
128.96.168.0255.255.254.0Interface 1
128.96.166.0255.255.254.0R2
128.96.164.0255.255.252.0R3
0.0.0.0DefaultR4

For each IP address in Group I, identify the correct choice of the next hop from Group II using the entries from the routing table above.

Group I

i. 128.96.171.92
ii. 128.96.167.151
iii. 128.96.163.151
iv. 128.96.165.121

Group II

a. Interface 0
b. Interface 1
c. R2
d. R3
e. R4

  • (A)
    i-a, ii-c, iii-e, iv-d
  • (B)
    i-a, ii-d, iii-b, iv-e
  • (C)
    i-b, ii-c, iii-d, iv-e
  • (D)
    i-b, ii-c, iii-e, iv-d

Answer (official key): A

Worked solution: in your report after you take this paper.

Q47 · Algorithms · MCQ · 2 marks

Given below are some algorithms and some algorithm design paradigms.

AlgorithmParadigm
1. Dijkstra's Shortest Pathi. Divide and Conquer
2. Floyd-Warshall algorithm to compute all pairs shortest pathii. Dynamic Programming
3. Binary search on a sorted arrayiii. Greedy design
4. Backtracking search on a graphiv. Depth-first search
v. Breadth-first search

Match the above algorithms on the left to the corresponding design paradigm they follow.

  • (A)
    1-i, 2-iii, 3-i, 4-v
  • (B)
    1-iii, 2-iii, 3-i, 4-v
  • (C)
    1-iii, 2-ii, 3-i, 4-iv
  • (D)
    1-iii, 2-ii, 3-i, 4-v

Answer (official key): C

Worked solution: in your report after you take this paper.

Q48 · Operating System · MCQ · 2 marks

Consider six memory partitions of sizes 200 KB, 400 KB, 600 KB, 500 KB, 300 KB and 250 KB.

These partitions need to be allotted to four processes of sizes 357 KB, 210 KB, 468 KB and 491 KB in that order.

If the best fit algorithm is used, which partitions are NOT allotted to any process?

  • (A)
    200 KB and 300 KB
  • (B)
    200 KB and 250 KB
  • (C)
    250 KB and 300 KB
  • (D)
    300 KB and 400 KB

Answer (official key): A

Worked solution: in your report after you take this paper.

Q49 · Programming and Data Structures · MCQ · 2 marks

Which one of the following hash functions on integers will distribute keys most uniformly over 10 buckets numbered 0 to 9 for ii ranging from 0 to 2020?

  • (A)
    h(i)=i2 mod 10h(i)=i^2\bmod 10
  • (B)
    h(i)=i3 mod 10h(i)=i^3\bmod 10
  • (C)
    h(i)=(11∗i2) mod 10h(i)=(11*i^2)\bmod 10
  • (D)
    h(i)=(12∗i) mod 10h(i)=(12*i)\bmod 10

Answer (official key): B

Worked solution: in your report after you take this paper.

Q50 · Algorithms · MCQ · 2 marks

Suppose you are provided with the following function declaration in the C programming language.

int partition(int a[], int n);

The function treats the first element of a[] as a pivot, and rearranges the array so that all elements less than or equal to the pivot are in the left part of the array, and all elements greater than the pivot are in the right part.

In addition, it moves the pivot so that the pivot is the last element of the left part.

The return value is the number of elements in the left part.

The following partially given function in the C programming language is used to find the kthk^{th} smallest element in an array a[] of size nn using the partition function. Assume k≤nk \le n.

int kth_smallest(int a[], int n, int k) {
    int left_end = partition(a, n);

    if (left_end + 1 == k) {
        return a[left_end];
    }

    if (left_end + 1 > k) {
        return kth_smallest( __________ );
    }
    else {
        return kth_smallest( __________ );
    }
}

The missing argument lists are respectively:

  • (A)
    (a, left_end, k) and (a + left_end + 1, n - left_end - 1, k - left_end)
  • (B)
    (a, left_end, k) and (a + left_end + 1, n - left_end - 1, k - left_end - 1)
  • (C)
    (a + left_end + 1, n - left_end - 1, k - left_end - 1) and (a, left_end, k)
  • (D)
    (a, n - left_end - 1, k - left_end - 1) and (a, left_end, k)

Answer (official key): B

Worked solution: in your report after you take this paper.

Q51 · Computer Organization and Architecture · MCQ · 2 marks

Consider a processor with byte-addressable memory.

Assume that all registers, including Program Counter (PC) and Program Status Word (PSW), are of size 2 bytes.

A stack in the main memory is implemented from memory location (0100)16(0100)_{16} and it grows upward.

The stack pointer (SP) points to the top element of the stack.

The current value of SP is (016E)16(016E)_{16}.

The CALL instruction is of two words, the first word is the op-code and the second word is the starting address of the subroutine. One word is 2 bytes.

The CALL instruction is implemented as follows:

  • Store the current value of PC in the stack.
  • Store the value of PSW register in the stack.
  • Load the starting address of the subroutine in PC.

The content of PC just before the fetch of a CALL instruction is (5FA0)16(5FA0)_{16}.

After execution of the CALL instruction, the value of the stack pointer is:

  • (A)
    (016A)16(016A)_{16}
  • (B)
    (016C)16(016C)_{16}
  • (C)
    (0170)16(0170)_{16}
  • (D)
    (0172)16(0172)_{16}

Answer (official key): D

Worked solution: in your report after you take this paper.

Q52 · Digital Logic · Numerical · 2 marks

A half adder is implemented with XOR and AND gates.

A full adder is implemented with two half adders and one OR gate.

The propagation delay of an XOR gate is twice that of an AND/OR gate.

The propagation delay of an AND/OR gate is 1.2 microseconds.

A 4-bit ripple-carry binary adder is implemented by using four full adders.

The total propagation time of this 4-bit binary adder in microseconds is __________.

Answer (official key): 19.2

Worked solution: in your report after you take this paper.

Q53 · Probability and Statistics · Numerical · 2 marks

Let XX and YY denote the sets containing 2 and 20 distinct objects respectively, and FF denote the set of all possible functions defined from XX to YY.

Let ff be randomly chosen from FF.

The probability of ff being one-to-one is __________.

Answer (official key): 0.95

Worked solution: in your report after you take this paper.

Q54 · Theory of Computation · MCQ · 2 marks

Consider the alphabet Σ={0,1}\Sigma=\{0,1\}, the null or empty string λ\lambda, and the sets of strings X0,X1,X2X_0,X_1,X_2 generated by the corresponding non-terminals of a regular grammar.

X0,X1,X2X_0,X_1,X_2 are related as follows:

X0=1X1X_0=1X_1 X1=0X1+1X2X_1=0X_1+1X_2 X2=0X1+{λ}X_2=0X_1+\{\lambda\}

Which one of the following choices precisely represents the strings in X0X_0?

  • (A)
    10(0∗+(10)∗)110(0^*+(10)^*)1
  • (B)
    10(0∗+(10)∗)∗110(0^*+(10)^*)^*1
  • (C)
    1(0+10)∗11(0+10)^*1
  • (D)
    10(0+10)∗1+110(0+10)∗110(0+10)^*1+110(0+10)^*1

Answer (official key): C

Worked solution: in your report after you take this paper.

Q55 · Calculus · MCQ · 2 marks

The secant method is used to find the root of an equation f(x)=0f(x)=0.

It is started from two distinct estimates xax_a and xbx_b for the root. It is an iterative procedure involving linear interpolation to a root.

The iteration stops if f(xb)f(x_b) is very small and then xbx_b is the solution. The procedure is given below.

Observe that there is an expression which is missing and is marked by ?.

Secant

Initialize: x_a, x_b, ε, N       // ε = convergence indicator
                                  // N = maximum no. of iterations

f_b = f(x_b)
i = 0

while (i < N and |f_b| > ε) do
    i = i + 1                    // update counter
    x_t = ?                      // missing expression for intermediate value

    x_a = x_b                    // reset x_a
    x_b = x_t                    // reset x_b
    f_b = f(x_b)                 // function value at new x_b
end while

if |f_b| > ε then                // loop is terminated with i = N
    write "Non-Convergence"
else
    write "return x_b"
end if

Which is the suitable expression to be put in place of ? so that it follows all steps of the secant method?

  • (A)
    xb−(fb−f(xa))fbxb−xax_b-\dfrac{(f_b-f(x_a))f_b}{x_b-x_a}
  • (B)
    xa−(fb−f(xa))faxb−xax_a-\dfrac{(f_b-f(x_a))f_a}{x_b-x_a}
  • (C)
    xb−(xb−xa)fbfb−f(xa)x_b-\dfrac{(x_b-x_a)f_b}{f_b-f(x_a)}
  • (D)
    xa−(xb−xa)fafb−f(xa)x_a-\dfrac{(x_b-x_a)f_a}{f_b-f(x_a)}

Answer (official key): C

Worked solution: in your report after you take this paper.

Q56 · Linear Algebra · Numerical · 2 marks

Perform the following operations on the matrix

[344579105132195].\begin{bmatrix} 3 & 4 & 45\\ 7 & 9 & 105\\ 13 & 2 & 195 \end{bmatrix}.

(i) Add the third row to the second row.

(ii) Subtract the third column from the first column.

The determinant of the resultant matrix is __________.

Answer (official key): 0

Worked solution: in your report after you take this paper.

Q57 · Digital Logic · Numerical · 2 marks

The number of minterms after minimizing the following Boolean expression is __________.

[D′+AB′+A′C+AC′D+A′C′D]′\left[D' + AB' + A'C + AC'D + A'C'D\right]'

Answer (official key): 1

Worked solution: in your report after you take this paper.

Q58 · Programming and Data Structures · Numerical · 2 marks

Consider the C program below.

#include <stdio.h>
int *A, stkTop;

int stkFunc(int opcode, int val)
{
    static int size = 0, stkTop = 0;

    switch (opcode) {
        case -1: size = val; break;
        case 0:  if (stkTop < size) A[stkTop++] = val; break;
        default: if (stkTop) return A[--stkTop];
    }

    return -1;
}

int main()
{
    int B[20]; A = B; stkTop = -1;

    stkFunc(-1, 10);
    stkFunc(0, 5);
    stkFunc(0, 10);

    printf("%d\n", stkFunc(1, 0) + stkFunc(1, 0));
}

The value printed by the above program is __________.

Answer (official key): 15

Worked solution: in your report after you take this paper.

Q59 · Calculus · MCQ · 2 marks

Let

f(x)=x−1/3f(x)=x^{-1/3}

and AA denote the area of the region bounded by f(x)f(x) and the X-axis, when xx varies from −1-1 to 11.

Which of the following statements is/are TRUE?

I. ff is continuous in [−1,1][-1,1]

II. ff is not bounded in [−1,1][-1,1]

III. AA is nonzero and finite

  • (A)
    II only
  • (B)
    III only
  • (C)
    II and III only
  • (D)
    I, II and III

Answer (official key): C

Worked solution: in your report after you take this paper.

Q60 · Discrete Mathematics · MCQ · 2 marks

A graph is self-complementary if it is isomorphic to its complement.

For all self-complementary graphs on nn vertices, nn is:

  • (A)
    A multiple of 4
  • (B)
    Even
  • (C)
    Odd
  • (D)
    Congruent to 0(mod4)0 \pmod 4, or 1(mod4)1 \pmod 4

Answer (official key): D

Worked solution: in your report after you take this paper.

Q61 · Discrete Mathematics · MCQ · 2 marks

Which one of the following well-formed formulae is a tautology?

  • (A)
    ∀x ∃y R(x,y)⇔∃y ∀x R(x,y)\forall x\ \exists y\ R(x,y) \Leftrightarrow \exists y\ \forall x\ R(x,y)
  • (B)
    (∀x [∃y R(x,y)→S(x,y)])→∀x∃y S(x,y)(\forall x\ [\exists y\ R(x,y)\to S(x,y)]) \to \forall x\exists y\ S(x,y)
  • (C)
    [∀x∃y (P(x,y)→R(x,y))]⇔[∀x∃y (¬P(x,y)∨R(x,y))][\forall x\exists y\ (P(x,y)\to R(x,y))]\Leftrightarrow[\forall x\exists y\ (\neg P(x,y)\vee R(x,y))]
  • (D)
    ∀x∀y P(x,y)→∀x∀y P(y,x)\forall x\forall y\ P(x,y)\to \forall x\forall y\ P(y,x)

Answer (official key): C

Worked solution: in your report after you take this paper.

Q62 · Programming and Data Structures · MCQ · 2 marks

Which one of the following assertions concerning code inspection and code walkthrough is true?

  • (A)
    Code inspection is carried out once the code has been unit tested.
  • (B)
    Code inspection and code walkthrough are synonyms.
  • (C)
    Adherence to coding standards is checked during code inspection.
  • (D)
    Code walkthrough is usually carried out by an independent test team.

Answer (official key): C

Worked solution: in your report after you take this paper.

Q63 · Discrete Mathematics · Numerical · 2 marks

The number of onto functions, surjective functions, from set

X={1,2,3,4}X=\{1,2,3,4\}

to set

Y={a,b,c}Y=\{a,b,c\}

is __________.

Answer (official key): 36

Worked solution: in your report after you take this paper.

Q64 · Computer Organization and Architecture · Numerical · 2 marks

Consider the sequence of machine instructions given below.

MUL   R5, R0, R1
DIV   R6, R2, R3
ADD   R7, R5, R6
SUB   R8, R7, R4

In the above sequence, R0R0 to R8R8 are general purpose registers. In the instructions shown, the first register stores the result of the operation performed on the second and third registers.

This sequence of instructions is to be executed in a pipelined instruction processor with the following 4 stages:

  1. Instruction Fetch and Decode (IF)
  2. Operand Fetch (OF)
  3. Perform Operation (PO)
  4. Write back the result (WB)

The IF, OF and WB stages take 1 clock cycle each for any instruction.

The PO stage takes:

  • 1 clock cycle for ADD or SUB instruction,
  • 3 clock cycles for MUL instruction,
  • 5 clock cycles for DIV instruction.

The pipelined processor uses operand forwarding from the PO stage to the OF stage.

The number of clock cycles taken for the execution of the above sequence of instructions is __________.

Answer (official key): 13

Worked solution: in your report after you take this paper.

Q65 · Discrete Mathematics · MCQ · 2 marks

In a connected graph, a bridge is an edge whose removal disconnects a graph.

Which one of the following statements is true?

  • (A)
    A tree has no bridges.
  • (B)
    A bridge cannot be part of a simple cycle.
  • (C)
    Every edge of a clique with size ≥3\ge 3 is a bridge.
  • (D)
    A graph with bridges cannot have a cycle.

Answer (official key): B

Worked solution: in your report after you take this paper.