Computer Science Engineering - Online Test

Q1. Suppose R1  are two relation schemas. Let r1 and r2 be the corresponding relation instances. B is a foreign key that refers to C in R2. If data in r1 and r2 satisfy referential integrity constrains, which of the following is ALWAYS TRUE?
Answer : Option A
Explaination / Solution:
No Explaination.


Q2. Which one of the following expressions does NOT represent exclusive NOR of x and y?
Answer : Option D
Explaination / Solution:



Q3. What is the time complexity of Bellman-Ford single-source shortest path algorithm on a complete graph of n vertices?
Answer : Option C
Explaination / Solution:

Bellman-ford time complexity: Θ(|V| × |E|)
For complete graph:  |E| = n(n - 1)/2
|V| = n
Θ(n × (n(n - 1)/2) = Θ(n3)

Q4. The smallest integer than can be represented by an 8-bit number in 2’s complement form is
Answer : Option B
Explaination / Solution:



Q5. Determine the maximum length of cable (in km) for transmitting data at a rate of 500 Mbps in an Ethernet LAN with frames of size 10,000 bits. Assume the signal speed in the cable to be 2,00,000 km/s
Answer : Option B
Explaination / Solution:



Q6. Consider two binary operators '↑' and '↓' with the precedence of operator ↓ being lower than that of the operator ↑ . Operator ↑ is right associative while operator ↓, is left associative. Which one of the following represents the parse tree for expression (7 ↓ 3 ↑ 4 ↑ 3 ↓ 2)?
Answer : Option B
Explaination / Solution:

7 ↓ 3 ↑ 4 ↑ 3 ↓ 2 7 ↓ 3 ↑ (4 ↑ 3) ↓ 2 as ↑ is right associative 7 ↓ (3 ↑ (4 ↑ 3)) ↓ 2 (7 ↓ (3 ↑ (4 ↑ 3))) ↓ 2 as ↓ is left associative

Q7. Which of the following problems are decidable? 
1) Does a given program ever produce an output? 
2) If L is context-free language, then, is  also context-free? 
3) If L is regular language, then, is  also regular? 
4) If L is recursive language, then, is  also recursive?
Answer : Option D
Explaination / Solution:

CFL’s are not closed under complementation. Regular and recursive languages are closed under complementation.

Q8. The amount of ROM needed to implement a 4 bit multiplier is
Answer : Option D
Explaination / Solution:

For a 4 bit multiplier there are 24 × 24 = 28 = 256 combinations. 
Output will contain 8 bits. 
So the amount of ROM needed is 28 ×8 bits = 2Kbits

Q9. Consider the following relations A, B and C:

How many tuples does the result of the following SQL query contain? 
SELECT A.Id 
FROM A 
WHERE A.Age > ALL(SELECT B.Age FROM B WHERE B.Name = ‘Arun’)
Answer : Option B
Explaination / Solution:

As the result of subquery is an empty table, ‘>ALL’ comparison is true . Therefore, all the three row id’s of A will be selected from table A.

Q10. A scheduling algorithm assigns priority proportional to the waiting time of a process. Every process starts with priority zero(the lowest priority). The scheduler re-evaluates the process priorities every T time units and decides the next process to schedule. Which one of the following is TRUE if the processes have no I/O operations and all arrive at time zero?
Answer : Option B
Explaination / Solution:

The given scheduling definition takes two parameters, one is dynamically assigned process priority and the other is ‘T’ time unit to re-evaluate the process priorities. This dynamically assigned priority will be deciding processes order in ready queue of round robin algorithm whose time quantum is same as ‘T’ time units. As all the processes are arriving at the same time, they will be given same priority but soon after first ‘T’ time burst remaining processes will get higher priorities