Computer Science & Information Technology (CS) 2021 [Session 2]
Review the key details, then start the test when you are ready. You can also open the full package to see related papers.
Paper pattern & analysis
Available question types, difficulty and classifications for this paper.
Topic distribution
Subtopic distribution
Difficulty distribution
Question type distribution
Practise paper questions
Choose your answer to check it. Log in to view the explanation. For a timed attempt and result, start the exam.

Which one of the following options maintains a similar logical relation in the above?
Which one of the following statements is the CORRECT inference of the above passage?
The total number of students in all the three classes in the beginning was:
The ratio of the selling price in Year 2 to the selling price in Year 3 is ______.

Observation I: S is taller than R.
Observation II: Q is the shortest of all.
Observation III: U is taller than only one student.
Observation IV: T is taller than S but is not the tallest.
The number of students that are taller than R is the same as the number of students shorter than ______.
\( S_1 \): Set of all \( n \times n \) matrices with entries from the set \( \{ a, b, c \} \)
\( S_2 \): Set of all functions from the set \( \{ 0, 1, 2, \dots, n^2 - 1 \} \) to the set \( \{ 0, 1, 2 \} \)
Which of the following choice(s) is/are correct?
\[ S : ((P \wedge Q) \rightarrow R) \rightarrow ((P \wedge Q) \rightarrow (Q \rightarrow R)) \]
The value of |A – B| is __________
The number of strings of length 8 accepted by the above automaton is __________
int SomeFunction(int x, int y)
{
if ((x == 1) || (y == 1)) return 1;
if (x == y) return x;
if (x > y) return SomeFunction(x - y, y);
if (y > x) return SomeFunction(x, y - x);
}
The value returned by SomeFunction(15, 255) is __________
Consider the string abbcccddddeee. Each letter in the string must be assigned a binary code satisfying the following properties:
1. For any two letters, the code assigned to one letter must not be a prefix of the code assigned to the other letter.
2. For any two letters of the same frequency, the letter which occurs earlier in the dictionary order is assigned a code whose length is at most the length of the code assigned to the other letter.
Among the set of all binary code assignments which satisfy the above two properties, what is the minimum length of the encoded string?
Assume a two-level inclusive cache hierarchy, L1 and L2, where L2 is the larger of the two. Consider the following statements:
S1 : Read misses in a write through L1 cache do not result in writebacks of dirty lines to the L2.
S2 : Write allocate policy must be used in conjunction with write through caches and no-write allocate policy is used with writeback caches.
Which of the following statements is correct?
Input sequence: 00100011000011100
Output sequence: 00000001000001100
A Mealy Machine is a state machine where both the next state and the output are functions of the present state and the current input.
The above mentioned circuit can be designed as a two-state Mealy machine. The states in the Mealy machine can be represented using Boolean values 0 and 1. We denote the current state, the next state, the next incoming bit, and the output bit of the Mealy machine by the variables s, t, b and y respectively. Assume the initial state of the Mealy machine is 0.
What are the Boolean expressions corresponding to t and y in terms of s and b?
- If the first question is answered wrong, the student gets zero marks.
- If the first question is answered correctly and the second question is not answered correctly, the student gets the marks only for the first question.
- If both the questions are answered correctly, the student gets the sum of the marks of the two questions.
The following table shows the probability of correctly answering a question and the marks of the question respectively.
| question | probability of answering correctly | marks |
|---|---|---|
| QuestionA | 0.8 | 10 |
| QuestionB | 0.5 | 20 |
Assuming that the student always wants to maximize her expected marks in the examination, in which order should she attempt the questions and what is the expected marks for that order (assume that the questions are independent)?
z = x + 3 + y->f1 + y->f2;
for (i = 0; i < 200; i = i + 2) {
if (z > i) {
p = p + x + 3;
q = q + y->f1;
} else {
p = p + y->f2;
q = q + x + 3;
}
}
Assume that the variable y points to a struct (allocated on the heap) containing two fields f1 and f2, and the local variables x, y, z, p, q, and i are allotted registers. Common sub-expression elimination (CSE) optimization is applied on the code. The number of addition and dereference operations (of the form y->f1 or y->f2) in the optimized code, respectively, are:
emp(empId, name, gender, salary, deptId)
Consider the following SQL query:
select deptId, count(*)
from emp
where gender = 'female' and salary > (select avg(salary) from emp)
group by deptId;
The above query gives, for each department in the company, the number of female employees whose salary is greater than the average salary of
#include <stdio.h>
#include <stdlib.h>
struct Node{
int value;
struct Node *next;};
int main(){
struct Node *boxE, *head, *boxN; int index = 0;
boxE = head = (struct Node *) malloc(sizeof(struct Node));
head->value = index;
for (index = 1; index <= 3; index++){
boxN = (struct Node *) malloc(sizeof(struct Node));
boxE->next = boxN;
boxN->value = index;
boxE = boxN; }
for (index = 0; index <= 3; index++) {
printf("Value at index %d is %d\n", index, head->value);
head = head->next;
printf("Value at index %d is %d\n", index+1, head->value); } }
Which one of the statements below is correct about the program?
S1: Every infinite regular language contains an undecidable language as a subset.
S2: Every finite language is regular.
Which one of the following choices is correct?
\[ s(P, Q) = \sum_{i=1}^{n} (P[i] \cdot Q[i]) \]
Let L be a set of 10-dimensional non-zero real vectors such that for every pair of distinct vectors P, Q ∈ L, s(P, Q) = 0. What is the maximum cardinality possible for the set L?
For a statement \(S\) in a program, in the context of liveness analysis, the following sets are defined:
\(USE(S)\) : the set of variables used in \(S\)
\(IN(S)\) : the set of variables that are live at the entry of \(S\)
\(OUT(S)\) : the set of variables that are live at the exit of \(S\)
Consider a basic block that consists of two statements, \(S_1\) followed by \(S_2\). Which one of the following statements is correct?
For constants \(a \geq 1\) and \(b > 1\), consider the following recurrence defined on the non-negative integers:
\[ T(n) = a \cdot T\left(\frac{n}{b}\right) + f(n) \]
Which one of the following options is correct about the recurrence \(T(n)\)?
Suppose the following functional dependencies hold on a relation U with attributes \(P, Q, R, S\), and \(T\):
\[ P \rightarrow QR \]
\[ RS \rightarrow T \]
Which of the following functional dependencies can be inferred from the above functional dependencies?
For a string \(w\), we define \(w^R\) to be the reverse of \(w\). For example, if \(w = 01101\) then \(w^R = 10110\).
Which of the following languages is/are context-free?
int x = 0; // global
Lock L1; // global
main() {
create a thread to execute foo(); // Thread T1
create a thread to execute foo(); // Thread T2
wait for the two threads to finish execution;
print (x);
}
foo() {
int y = 0;
Acquire L1;
x = x + 1;
y = y + 1;
Release L1;
print (y);
}
Which of the following statement(s) is/are correct?
function OWN_RESOURCE(Resource R)
Acquire lock L // a global lock
if R is available then
Acquire R
Release lock L
else
if R is owned by another process P then
Terminate P, after releasing all resources owned by P
Acquire R
Restart P
Release lock L
end if
end if
end function
Which of the following choice(s) about the above scheme is/are correct?
The objective is to find the shortest-cost path from the router R to routers P and Q. Assume that R does not initially know the shortest routes to P and Q. Assume that R has three neighbouring routers denoted as X, Y, and Z. During one iteration, R measures its distance to its neighbours X, Y, and Z as 3, 2, and 5, respectively. Router R gets routing vectors from its neighbours that indicate that the distance to router P from routers X, Y, and Z are 7, 6, and 5, respectively. The routing vector also indicates that the distance to router Q from routers X, Y, and Z are 4, 6, and 8, respectively. Which of the following statement(s) is/are correct with respect to the new routing table of R, after updation during this iteration?

Which of the following is/are correct about the graph?
<-------------------- 39-bit virtual address -------------------->
| Level 1 | Level 2 | Level 3 | Page |
| offset | offset | offset | offset |
| 9 bits | 9 bits | 9 bits | 12 bits |
The page size is 4KB (1KB = 210 bytes) and page table entry size at every level is 8 bytes. A process P is currently using 2GB (1GB = 230 bytes) virtual memory which is mapped to 2GB of physical memory. The minimum amount of memory required for the page table of P across all levels is __________ KB.
#include <stdio.h>
int foo(int x, int y, int q)
{
if ((x <= 0) && (y <= 0))
return q;
if (x <= 0)
return foo(x, y-q, q);
if (y <= 0)
return foo(x-q, y, q);
return foo(x, y-q, q) + foo(x-q, y, q);
}
int main()
{
int r = foo(15,15,10);
printf("%d", r);
return 0;
}
The output of the program upon execution is __________
S' → S
S → S # c S
S → S S
S → S @
S → < S >
S → a
S → b
S → c
Let I0 = CLOSURE({S' → •S}). The number of items in the set GOTO(GOTO(I0, <), <) is __________
f(w, 0, 0, z) = 1
f(1, x, 1, z) = x + z
f(w, 1, y, z) = wz + y
The number of literals in the minimal sum-of-products expression of f is __________
Consider the following sequence of 8 instructions:
ADD, MUL, ADD, MUL, ADD, MUL, ADD, MUL
Assume that every MUL instruction is data-dependent on the ADD instruction just before it and every ADD instruction (except the first ADD) is data-dependent on the MUL instruction just before it. The Speedup is defined as follows:
\[ Speedup = \frac{\text{Execution time without operand forwarding}}{\text{Execution time with operand forwarding}} \]
The Speedup achieved in executing the given instruction sequence on the pipelined processor (rounded to 2 decimal places) is __________
The sum of the quality-scores of all the vertices in the graph shown above is __________
\( S_1 \): There exists a minimum weight edge in \( G \) which is present in every minimum spanning tree of \( G \).
\( S_2 \): If every edge in \( G \) has distinct weight, then \( G \) has a unique minimum spanning tree.
Which one of the following options is correct?
int main() { Integer x; return 0; }
Which one of the following phases in a seven-phase C compiler will throw an error?
| sign | exponent | mantissa |
|---|
Which one of the following choices is correct with respect to the smallest normalized positive number represented using the standard?
#include <stdio.h> int main(){ int arr[4][5]; int i, j; for (i=0; i<4; i++){ for (j=0; j<5; j++){ arr[i][j] = 10*i + j; } } printf("%d", *(arr[1] + 9)); return 0; }What is the output of the above program?
Showing 5 of 65 questions