CS224S6
CS224S6
Q.1 If ‘→’ denotes increasing order of intensity, then the meaning of the words
(A) phased
(B) phrased
(C) fazed
(D) fused
Q.2 Two wizards try to create a spell using all the four elements, water, air, fire, and
earth. For this, they decide to mix all these elements in all possible orders. They
also decide to work independently. After trying all possible combination of
elements, they conclude that the spell does not work.
How many attempts does each wizard make before coming to this conclusion,
independently?
(A) 24
(B) 48
(C) 16
(D) 12
Page 1 of 40
Organizing Institute: IISc, Bengaluru
Computer Science and Information Technology Set 2 (CS2)
Q.3 In an engineering college of 10,000 students, 1,500 like neither their core branches
nor other branches. The number of students who like their core branches is 1/4th of
the number of students who like other branches. The number of students who like
both their core and other branches is 500.
(A) 1,800
(B) 3,500
(C) 1,600
(D) 1,500
(A) 1
(B) 1/2
(C) 2
(D) 4
Page 2 of 40
Organizing Institute: IISc, Bengaluru
Computer Science and Information Technology Set 2 (CS2)
(A) 25
(B) 21
(C) 18
(D) 20
Page 3 of 40
Organizing Institute: IISc, Bengaluru
Computer Science and Information Technology Set 2 (CS2)
R: The natural process of the cooling of this massive edifice absorbed large
quantities of atmospheric carbon dioxide, altering the earth’s atmosphere and
making it better suited for life.
S: Many millennia ago, a breakaway chunk of bedrock from the Antarctic Plate
collided with the massive Eurasian Plate.
(A) QPSR
(B) QSPR
(C) SPRQ
(D) SRPQ
Page 4 of 40
Organizing Institute: IISc, Bengaluru
Computer Science and Information Technology Set 2 (CS2)
Q.7 A person sold two different items at the same price. He made 10% profit in one
item, and 10% loss in the other item. In selling these two items, the person made a
total of
(A) 1% profit
(B) 2% profit
(C) 1% loss
(D) 2% loss
Page 5 of 40
Organizing Institute: IISc, Bengaluru
Computer Science and Information Technology Set 2 (CS2)
Q.8 The pie charts depict the shares of various power generation technologies in the
total electricity generation of a country for the years 2007 and 2023.
Solar Coal
Coal 20% 20%
Hydro
35%
30% Gas
15%
Hydro
Gas 35%
25%
Wind
Wind
10%
5%
The renewable sources of electricity generation consist of Hydro, Solar and Wind.
Assuming that the total electricity generated remains the same from 2007 to 2023,
what is the percentage increase in the share of the renewable sources of electricity
generation over this period?
(A) 25%
(B) 50%
(C) 77.5%
(D) 62.5%
Page 6 of 40
Organizing Institute: IISc, Bengaluru
Computer Science and Information Technology Set 2 (CS2)
Q.9 A cube is to be cut into 8 pieces of equal size and shape. Here, each cut should be
straight and it should not stop till it reaches the other end of the cube.
(A) 3
(B) 4
(C) 7
(D) 8
Page 7 of 40
Organizing Institute: IISc, Bengaluru
Computer Science and Information Technology Set 2 (CS2)
Q.10 In the 4 × 4 array shown below, each cell of the first three rows has either a
cross (X) or a number.
The number in a cell represents the count of the immediate neighboring cells
(left, right, top, bottom, diagonals) NOT having a cross (X). Given that the last row
has no crosses (X), the sum of the four numbers to be filled in the last row is
(A) 11
(B) 10
(C) 12
(D) 9
Page 8 of 40
Organizing Institute: IISc, Bengaluru
Computer Science and Information Technology Set 2 (CS2)
Consider a computer with a 4 MHz processor. Its DMA controller can transfer
8 bytes in 1 cycle from a device to main memory through cycle stealing at regular
Q.11
intervals. Which one of the following is the data transfer rate (in bits per second) of
the DMA controller if 1% of the processor cycles are used for DMA?
(A) 2,56,000
(B) 3,200
(C) 25,60,000
(D) 32,000
Consider the statement: “Fail grade cannot be given when student scores more than
50% marks.”
Which one of the following is the CORRECT representation of the above statement
in propositional logic?
(A) 𝑞 → ¬𝑝
(B) 𝑞→𝑝
(C) 𝑝→𝑞
(D) ¬𝑝 → 𝑞
Page 9 of 40
Organizing Institute: IISc, Bengaluru
Computer Science and Information Technology Set 2 (CS2)
Q.13 Consider the following C program. Assume parameters to a function are evaluated
from right to left.
#include <stdio.h>
int main() {
f(g(10),h(20));
}
Which one of the following options is the CORRECT output of the above
C program?
(A) 20101020
(B) 10202010
(C) 20102010
(D) 10201020
Page 10 of 40
Organizing Institute: IISc, Bengaluru
Computer Science and Information Technology Set 2 (CS2)
(D)
0 0111 1111 0000 0000 0000 0000 0000 000
Page 11 of 40
Organizing Institute: IISc, Bengaluru
Computer Science and Information Technology Set 2 (CS2)
𝑇(0) = 1,
𝑇(1) = 2, and
𝑇(𝑛) = 5𝑇(𝑛 − 1) − 6𝑇(𝑛 − 2) for 𝑛 ≥ 2
𝑓(𝑥) = 1 − 𝑓(2 − 𝑥)
2
Which one of the following options is the CORRECT value of ∫0 𝑓(𝑥)𝑑𝑥 ?
(A) 0
(B) 1
(C) 2
(D) −1
Page 12 of 40
Organizing Institute: IISc, Bengaluru
Computer Science and Information Technology Set 2 (CS2)
Q.17 Let 𝐴 be the adjacency matrix of a simple undirected graph 𝐺. Suppose 𝐴 is its own
inverse. Which one of the following statements is always TRUE?
(A) 𝐺 is a cycle
Q.18 When six unbiased dice are rolled simultaneously, the probability of getting all
distinct numbers (i.e., 1, 2, 3, 4, 5, and 6) is
1
(A)
324
5
(B)
324
7
(C)
324
11
(D)
324
Page 13 of 40
Organizing Institute: IISc, Bengaluru
Computer Science and Information Technology Set 2 (CS2)
Q.19 Once the DBMS informs the user that a transaction has been successfully
completed, its effect should persist even if the system crashes before all its changes
are reflected on disk. This property is called
(A) durability
(B) atomicity
(C) consistency
(D) isolation
Q.20 In the context of owner and weak entity sets in the ER (Entity-Relationship) data
model, which one of the following statements is TRUE?
(A) The weak entity set MUST have total participation in the identifying relationship
(B) The owner entity set MUST have total participation in the identifying relationship
Both weak and owner entity sets MUST have total participation in the identifying
(C)
relationship
Neither weak entity set nor owner entity set MUST have total participation in the
(D)
identifying relationship
Page 14 of 40
Organizing Institute: IISc, Bengaluru
Computer Science and Information Technology Set 2 (CS2)
Set X Set Y
Which one of the following options is the CORRECT match from Set X to Set Y ?
(A) P – 4; Q – 1; R – 3; S – 2
(B) P – 2; Q – 3; R – 1; S – 4
(C) P – 2; Q – 1; R – 3; S – 4
(D) P – 4; Q – 3; R – 2; S – 1
Page 15 of 40
Organizing Institute: IISc, Bengaluru
Computer Science and Information Technology Set 2 (CS2)
Q.22 Which one of the following regular expressions is equivalent to the language
accepted by the DFA given below?
0
1 0
Page 16 of 40
Organizing Institute: IISc, Bengaluru
Computer Science and Information Technology Set 2 (CS2)
Q.23 Node X has a TCP connection open to node Y. The packets from X to Y go through
an intermediate IP router R. Ethernet switch S is the first switch on the network path
between X and R. Consider a packet sent from X to Y over this connection.
Which of the following statements is/are TRUE about the destination IP and MAC
addresses on this packet at the time it leaves X?
Q.24 Which of the following tasks is/are the responsibility/responsibilities of the memory
management unit (MMU) in a system with paging-based memory management?
(B) Translate a virtual address to a physical address using the page table
(C) Raise a trap when a virtual address is not found in the page table
Raise a trap when a process tries to write to a page marked with read-only
(D)
permission in the page table
Page 17 of 40
Organizing Institute: IISc, Bengaluru
Computer Science and Information Technology Set 2 (CS2)
Q.25 Consider a process P running on a CPU. Which one or more of the following events
will always trigger a context switch by the OS that results in process P moving to a
non-running state (e.g., ready, blocked)?
(A) P makes a blocking system call to read a block of data from the disk
(B) P tries to access a page that is in the swap space, triggering a page fault
(C) An interrupt is raised by the disk to deliver data requested by some other process
Q.26 Which of the following file organizations is/are I/O efficient for the scan operation
in DBMS?
(A) Sorted
(B) Heap
Page 18 of 40
Organizing Institute: IISc, Bengaluru
Computer Science and Information Technology Set 2 (CS2)
Q.27 Which of the following statements about the Two Phase Locking (2PL) protocol
is/are TRUE?
With 2PL, a transaction always locks the data item being read or written just
(B)
before every operation and always releases the lock just after the operation
With 2PL, once a lock is released on any data item inside a transaction, no more
(C)
locks on any data item can be obtained inside that transaction
Q.28 Which of the following statements about IPv4 fragmentation is/are TRUE?
(C) The reassembly of fragments is performed only at the destination of the datagram
Page 19 of 40
Organizing Institute: IISc, Bengaluru
Computer Science and Information Technology Set 2 (CS2)
(C) Synthesized attributes can be evaluated by a bottom-up parser as the input is parsed
Q.30 For a Boolean variable 𝑥, which of the following statements is/are FALSE?
(A) 𝑥. 1 = 𝑥
(B) 𝑥+1=𝑥
(C) 𝑥. 𝑥 = 0
(D) 𝑥 + 𝑥̅ = 1
Page 20 of 40
Organizing Institute: IISc, Bengaluru
Computer Science and Information Technology Set 2 (CS2)
Page 21 of 40
Organizing Institute: IISc, Bengaluru
Computer Science and Information Technology Set 2 (CS2)
Q.32 Which of the following fields of an IP header is/are always modified by any router
before it forwards the IP packet?
(B) Protocol
char *b = a;
while(*b)
b++;
return b - a;}
Page 22 of 40
Organizing Institute: IISc, Bengaluru
Computer Science and Information Technology Set 2 (CS2)
Q.34 Let 𝑃 be the partial order defined on the set {1,2,3,4} as follows
Q.35 Let 𝐴be an array containing integer values. The distance of 𝐴 is defined as the
minimum number of elements in 𝐴 that must be replaced with another integer so
that the resulting array is sorted in non-decreasing order. The distance of the array
[2, 5, 3, 1, 4, 2, 6] is ___________
Page 23 of 40
Organizing Institute: IISc, Bengaluru
Computer Science and Information Technology Set 2 (CS2)
#include <stdio.h>
int main() {
p = a;
q = p + 1;
return 0;}
(A) 4,8
(B) 1,5
(C) 8,5
(D) 1,8
Page 24 of 40
Organizing Institute: IISc, Bengaluru
Computer Science and Information Technology Set 2 (CS2)
Q.37 Consider a single processor system with four processes A, B, C, and D, represented
as given below, where for each process the first value is its arrival time, and the
second value is its CPU burst time.
Which one of the following options gives the average waiting times when
preemptive Shortest Remaining Time First (SRTF) and Non-Preemptive Shortest
Job First (NP-SJF) CPU scheduling algorithms are applied to the processes?
Which one of the following CIDR prefixes exactly represents the range of
Q.38
IP addresses 10.12.2.0 to 10.12.3.255?
(A) 10.12.2.0/23
(B) 10.12.2.0/24
(C) 10.12.0.0/22
(D) 10.12.2.0/22
Page 25 of 40
Organizing Institute: IISc, Bengaluru
Computer Science and Information Technology Set 2 (CS2)
Q.39 You are given a set 𝑉 of distinct integers. A binary search tree 𝑇 is created by
inserting all elements of 𝑉 one by one, starting with an empty tree. The tree 𝑇
follows the convention that, at each node, all values stored in the left subtree of the
node are smaller than the value stored at the node. You are not aware of the sequence
in which these values were inserted into 𝑇, and you do not have access to 𝑇.
Page 26 of 40
Organizing Institute: IISc, Bengaluru
Computer Science and Information Technology Set 2 (CS2)
Q.40 Consider the following context-free grammar where the start symbol is 𝑆 and the
set of terminals is {𝑎,𝑏,𝑐,𝑑}.
𝑆 → 𝐴𝑎𝐴𝑏|𝐵𝑏𝐵𝑎
𝐴 → 𝑐𝑆|𝜖
𝐵 → 𝑑𝑆|𝜖
𝑎 𝑏 𝑐 𝑑 $
𝐴 𝐴→𝜖 (3) 𝐴 → 𝑐𝑆
𝐵 (4) 𝐵→𝜖 𝐵 → 𝑑𝑆
Which one of the following options represents the CORRECT combination for the
numbered cells in the parsing table?
Note: In the options, “blank” denotes that the corresponding cell is empty.
Page 27 of 40
Organizing Institute: IISc, Bengaluru
Computer Science and Information Technology Set 2 (CS2)
Q.41 Let 𝑀 be the 5-state NFA with 𝜖-transitions shown in the diagram below.
Which one of the following regular expressions represents the language accepted
by 𝑀 ?
Page 28 of 40
Organizing Institute: IISc, Bengaluru
Computer Science and Information Technology Set 2 (CS2)
The C code snippet given below has been written to compute the length of the
longest subarray of X that contains at most two distinct integers. The code has two
missing expressions labelled (𝑃)and (𝑄).
Which one of the following options gives the CORRECT missing expressions?
(Hint: At the end of the i-th iteration, the value of len1 is the length of the longest
subarray ending with X[i] that contains all equal values, and len2 is the length
of the longest subarray ending with X[i] that contains at most two distinct values.)
Page 29 of 40
Organizing Institute: IISc, Bengaluru
Computer Science and Information Technology Set 2 (CS2)
Q.43 Consider the following expression: 𝑥[𝑖] = (𝑝 + 𝑟) ∗ −𝑠[𝑖] + 𝑢/𝑤. The following
sequence shows the list of triples representing the given expression, with entries
missing for triples (1), (3), and (6).
(0) + 𝑝 𝑟
(1)
(3)
(4) / 𝑢 𝑤
(6)
Which one of the following options fills in the missing entries CORRECTLY?
Page 30 of 40
Organizing Institute: IISc, Bengaluru
Computer Science and Information Technology Set 2 (CS2)
Q.44 Let 𝑥 and 𝑦 be random variables, not necessarily independent, that take real values
in the interval [0,1]. Let 𝑧 = 𝑥𝑦 and let the mean values of 𝑥, 𝑦, 𝑧 be 𝑥̅ , 𝑦̅, 𝑧̅,
respectively. Which one of the following statements is TRUE?
(A) 𝑧̅ = 𝑥̅ 𝑦̅
(B) 𝑧̅ ≤ 𝑥̅ 𝑦̅
(C) 𝑧̅ ≥ 𝑥
̅ 𝑦̅
(D)
𝑧̅ ≤ 𝑥̅
Q.45 The relation schema, Person(pid,city), describes the city of residence for
every person uniquely identified by pid. The following relational algebra operators
are available: selection, projection, cross product, and rename.
To find the list of cities where at least 3 persons reside, using the above operators,
the minimum number of cross product operations that must be used is
(A) 1
(B) 2
(C) 3
(D) 4
Page 31 of 40
Organizing Institute: IISc, Bengaluru
Computer Science and Information Technology Set 2 (CS2)
Consider a multi-threaded program with two threads T1 and T2. The threads share
Q.46 two semaphores: s1 (initialized to 1) and s2 (initialized to 0). The threads also
share a global variable x (initialized to 0). The threads execute the code shown
below.
// code of T1 // code of T2
wait(s1); wait(s1);
x = x+1; x = x+1;
print(x); print(x);
wait(s2); signal(s2);
signal(s1); signal(s1);
Which of the following outcomes is/are possible when threads T1 and T2 execute
concurrently?
(C) T1 runs first and prints 1, T2 does not print anything (deadlock)
(D) T2 runs first and prints 1, T1 does not print anything (deadlock)
Let 𝐴 be an 𝑛 × 𝑛 matrix over the set of all real numbers ℝ. Let 𝐵 be a matrix
Q.47 obtained from 𝐴 by swapping two rows. Which of the following statements is/are
TRUE?
(D) If the trace of 𝐴 is zero, then the trace of 𝐵is also zero
Page 32 of 40
Organizing Institute: IISc, Bengaluru
Computer Science and Information Technology Set 2 (CS2)
Q.48 Let S1 and S2 be two stacks. S1 has capacity of 4 elements. S2 has capacity of
2 elements. S1 already has 4 elements: 100, 200, 300, and 400, whereas S2 is
empty, as shown below.
400 (Top)
300
200 Stack S2
100
Stack S1
Only the following three operations are available:
PushToS2: Pop the top element from S1 and push it on S2.
PushToS1: Pop the top element from S2 and push it on S1.
GenerateOutput: Pop the top element from S1 and output it to the
user.
Note that the pop operation is not allowed on an empty stack and the push operation
is not allowed on a full stack.
Which of the following output sequences can be generated by using the above
operations?
Page 33 of 40
Organizing Institute: IISc, Bengaluru
Computer Science and Information Technology Set 2 (CS2)
Q.49 Which of the following is/are EQUAL to 224 in radix-5 (i.e., base-5) notation?
(A) 64 in radix-10
(C) 50 in radix-16
Page 34 of 40
Organizing Institute: IISc, Bengaluru
Computer Science and Information Technology Set 2 (CS2)
Q.50 Consider 4-variable functions f1, f2, f3, f4 expressed in sum-of-minterms form as
given below.
f1 = ∑(0,2,3,5,7,8,11,13)
f2 = ∑(1,3,5,7,11,13, 15)
f3 = ∑(0,1,4,11)
f4 = ∑(0,2,6,13)
With respect to the circuit given above, which of the following options is/are
CORRECT?
(A) 𝒀 = ∑(0,1,2,11,13)
(C) 𝒀 = ∑(0,1,2,3,4,5,6,7)
(D) 𝒀 = Π(8,9,10,11,12,13,14,15)
Page 35 of 40
Organizing Institute: IISc, Bengaluru
Computer Science and Information Technology Set 2 (CS2)
Q.51 Let 𝐺 be an undirected connected graph in which every edge has a positive integer
weight. Suppose that every spanning tree in 𝐺 has even weight. Which of the
following statements is/are TRUE for every such graph 𝐺 ?
(B) All edges in 𝐺 have even weight OR all edges in 𝐺 have odd weight
In each cycle 𝐶 in 𝐺, either all edges in 𝐶 have even weight OR all edges in 𝐶
(D)
have odd weight
𝑆 → 𝑎𝑆, 𝑆 → 𝑎𝑆𝑏𝑆, 𝑆 → 𝑐
Page 36 of 40
Organizing Institute: IISc, Bengaluru
Computer Science and Information Technology Set 2 (CS2)
Q.53 Consider a disk with the following specifications: rotation speed of 6000 RPM,
average seek time of 5 milliseconds, 500 sectors/track, 512-byte sectors.
A file has content stored in 3000 sectors located randomly on the disk. Assuming
average rotational latency, the total time (in seconds, rounded off to 2 decimal
places) to read the entire file from the disk is _________
Q.54 Consider a TCP connection operating at a point of time with the congestion window
of size 12 MSS (Maximum Segment Size), when a timeout occurs due to packet
loss. Assuming that all the segments transmitted in the next two RTTs (Round Trip
Time) are acknowledged correctly, the congestion window size (in MSS) during the
third RTT will be _________
Q.55 Consider an Ethernet segment with a transmission speed of 108 bits/sec and a
maximum segment length of 500 meters. If the speed of propagation of the signal
in the medium is 2×108 meters/sec, then the minimum frame size (in bits) required
for collision detection is _________
For a relation 𝑅 with 4 attributes, the total number of possible useful functional
dependencies is ________
Q.57 A processor with 16 general purpose registers uses a 32-bit instruction format. The
instruction format consists of an opcode field, an addressing mode field, two register
operand fields, and a 16-bit scalar field. If 8 addressing modes are to be supported,
the maximum number of unique opcodes possible for every addressing mode
is _________
Page 37 of 40
Organizing Institute: IISc, Bengaluru
Computer Science and Information Technology Set 2 (CS2)
Q.59 The number of distinct minimum-weight spanning trees of the following graph
is _________
3
b c
1 2 2 1
2 2
a g d
2 2
1 1
f e
3
Q.60 The chromatic number of a graph is the minimum number of colours used in a
proper colouring of the graph. The chromatic number of the following graph
is _________
Page 38 of 40
Organizing Institute: IISc, Bengaluru
Computer Science and Information Technology Set 2 (CS2)
Q.61 A processor uses a 32-bit instruction format and supports byte-addressable memory
access. The ISA of the processor has 150 distinct instructions. The instructions are
equally divided into two types, namely R-type and I-type, whose formats are shown
below.
In the OPCODE, 1 bit is used to distinguish between I-type and R-type instructions
and the remaining bits indicate the operation. The processor has 50 architectural
registers, and all register fields in the instructions are of equal size.
Let 𝑋 be the number of bits used to encode the UNUSED field, 𝑌 be the number
of bits used to encode the OPCODE field, and 𝑍 be the number of bits used to
encode the immediate value/address field. The value of 𝑋 + 2𝑌 + 𝑍 is ________
Q.63 Let 𝑍𝑛 be the group of integers {0, 1, 2, … , 𝑛 − 1} with addition modulo 𝑛 as the
group operation. The number of elements in the group 𝑍2 × 𝑍3 × 𝑍4 that are their
own inverses is ________
Page 39 of 40
Organizing Institute: IISc, Bengaluru
Computer Science and Information Technology Set 2 (CS2)
Q.64 Consider a 32-bit system with 4 KB page size and page table entries of size 4 bytes
each. Assume 1 KB = 210 bytes. The OS uses a 2-level page table for memory
management, with the page table containing an outer page directory and an inner
page table. The OS allocates a page for the outer page directory upon process
creation. The OS uses demand paging when allocating memory for the inner page
table, i.e., a page of the inner page table is allocated only if it contains at least one
valid page table entry.
An active process in this system accesses 2000 unique pages during its execution,
and none of the pages are swapped out to disk. After it completes the page accesses,
let X denote the minimum and Y denote the maximum number of pages across the
two levels of the page table of the process.
Q.65 Consider the following augmented grammar, which is to be parsed with a SLR
parser. The set of terminals is {𝑎,𝑏,𝑐,𝑑,#,@}
𝑆′ → 𝑆
𝑆 → 𝑆𝑆|𝐴𝑎|𝑏𝐴𝑐|𝐵𝑐|𝑏𝐵𝑎
𝐴 → 𝑑#
𝐵→@
Let 𝐼0 = 𝐶𝐿𝑂𝑆𝑈𝑅𝐸({𝑆 ′ →• 𝑆}). The number of items in the set 𝐺𝑂𝑇𝑂(𝐼0 , 𝑆)
is ___________
Page 40 of 40
Organizing Institute: IISc, Bengaluru