Q1: Let P be "It is a hot day" and q be "The temperature is 48°C". Write in simple sentences the meaning of ~p Ʌ ~q.
(a) It is a hot day or temperature is 48°C
(b) It is cold day or temperature is 48°C
(c) It is neither a hot day nor temperature is 48°C
(d) It is not a hot day
Ans: C
Sol: The correct answer is It is neither a hot day nor temperature is 48°C
To understand the expression ~p ∧ ~q, we need to analyze it in the context of the propositions:
Interpretation of ~p ∧ ~q:
The expression ~p ∧ ~q means both of these statements are true simultaneously: "It is not a hot day and the temperature is not 48°C."
Simple Sentence:
So, the correct answer is: 3) It is neither a hot day nor the temperature is 48°C.
Q2: Arrange the following steps of file handling in C in the correct order:
(A) Close the file
(B) Read from or write to the file
(C) Open the file
(D) Check for error
Choose the correct answer from the options given below:
(a) (A), (C), (D), (B)
(b) (D), (B), (C), (A)
(c) (C), (D), (B), (A)
(d) (B), (D), (A), (C)
Ans: C
Sol: The correct answer is (C), (D), (B), (A).
fopen()
in C.NULL
.fread()
, fwrite()
, fprintf()
, fscanf()
, etc.fclose()
function to free up resources.Thus the correct answer is (C), (D), (B), (A).
Other Related Points
Q3: Out the following steps in the proper sequence for simplifying a Boolean function using a Karnaugh map (K-map).
(A) Identify and group the largest possible cluster of I's
(B) Draw the K-map for the given Boolean function
(C) Write the simplified Boolean expression from the grouped clusters
(D) Transfer the truth table values to the K-map
Choose the correct answer from the options given below:
(a) (B), (D), (A), (C)
(b) (D), (B), (A), (C)
(c) (B), (A), (D), (C)
(d) (A), (B), (C), (D)
Ans: A
Sol: The correct answer is (B), (D), (A), (C).
Thus the correct answer is (B), (D), (A), (C).
Other Related Points
Q4: Match List - I with List - II.
Choose the correct answer from the options given below:
(a) (A) - (II), (B) - (III), (C) - (IV), (D) - (I)
(b) (A) - (IV), (B) - (II), (C) - (III), (D) - (I)
(c) (A) - (IV), (B) - (I), (C) - (II), (D) - (III)
(d) (A) - (II), (B) - (IV), (C) - (III), (D) - (I)
Ans: C
Sol: The correct answer is A - IV, B - I, C - II, D - III
Half Adder:
Decoder:
Register:
Main Memory:
Therefore, the correct option is A - IV, B - I, C - II, D - III. So, the correct option is 3).
Q5: Find the correct sequence of the storage device in ascending order based on their access time(slowest to fastest).
(A) Registers
(B) Magnetic Disk
(C) Magnetic Tapes
(D) Main memory
(E) Optical Disk
Choose the correct answer from the options given below:
(a) (B), (A), (D), (C), (E)
(b) (B), (A), (E), (D), (C)
(c) (C), (B), (A), (E), (D)
(d) (C), (E), (B), (D), (A)
Ans: D
Sol: Question: Find the correct sequence of the storage devices in ascending order based on their access time (slowest to fastest).
Given Devices:
Access Time Comparison (Approximate):
Correct Ascending Order (Slowest to Fastest):
Correct Answer: Option 4) (C), (E), (B), (D), (A)
Q6: Consider the following statement regarding special purpose registers.
(A) Program Counter (PC) keeps track of the next instruction to be executed
(B) Instruction register holds the address of first instruction to be executed
(C) Accumulator holds the output of ALU
(D) Program Counter (PC) keeps the track of only first instruction of the program
Choose the correct answer from the options given below:
(a) (A) and (C) Only
(b) (A) and (D) Only
(c) (B) and (D) Only
(d) (A), (B) and (C) Only
Ans: A
Sol: The correct answer is 1)(A) and (C) Only
(A) Program Counter (PC) keeps the track of next instruction executed. -
(B) Instruction register holds the address of first instruction to be executed. -
(C) Accumulator holds the output of ALU. -
(D) Program Counter (PC) keeps the track of only first instruction of the program. -
Q7: Match List - I with List - II.
Choose the correct answer from the options given below:
(a) (A) - (I), (B) - (II), (C) - (III), (D) - (IV)
(b) (A) - (II), (B) - (IV), (C) - (III), (D) - (I)
(c) (A) - (III), (B) - (II), (C) - (IV), (D) - (I)
(d) (A) - (I), (B) - (IV), (C) - (III), (D) - (II)
Ans: B
Sol: The correct answer is A - II, B - IV, C - III, D - I
Representation of bits (A):
Physical Address (B):
Logical Address (C):
Segmentation and reassembly (D):
Therefore, the correct option is A - II, B - IV, C - III, D - I. So, the correct option is 2).
Q8: Which of the following properties correctly describe a Regular Grammar?
(A) All production rules are of the form A → x B or A → x, where A and B are non terminal symbols and x is a terminal symbol.
(B) Regular grammars are more powerful than context-free grammars and can express any type of language.
(C) There is a direct correspondence between regular grammar and finite automata.
(D) Regular grammars can generate languages that are not recognised by any type of automata.
Choose the correct answer from the options given below:
(a) (A) and (B) Only
(b) (B) and (C) Only
(c) (C) and (D) Only
(d) (A) and (C) Only
Ans: D
Sol: The correct answer is (A) and (C) Only
(A) All production rules are of the form A → xB or A → x, where A and B are non terminal symbols and x is a terminal symbol. -
(B) Regular grammars are more powerful than context-free grammars and can express any type of language. -
(C) There is a direct correspondence between regular grammar and finite automata. -
(D) Regular grammars can generate languages that are not recognised by any type of automata. -
Q9: Arrange the following steps in proper sequence involved in a Genetic Algorithm:
(A) Selection
(B) Initialization
(C) Crossover
(D) Mutation
(E) Evaluation
Choose the correct answer from the options given below:
(a) (A), (B), (C), (D), (E)
(b) (E), (A), (B), (D), (C)
(c) (B), (E), (A), (C), (D)
(d) (A), (C), (B), (D), (E)
Ans: C
Sol: The correct answer is (B), (E), (A), (C), (D).
Thus the correct answer is (B), (E), (A), (C), (D).
Other Related Points
Q10: Match List I with List - II.
Choose the correct answer from the options given below:
(a) (A) - (I), (B) - (II), (C) - (IV), (D) - (III)
(b) (A) - (III), (B) - (II), (C) - (I), (D) - (IV)
(c) (A) - (III), (B) - (I), (C) - (IV), (D) - (II)
(d) (A) - (II), (B) - (IV), (C) - (III), (D) - (I)
Ans: C
Sol:
Natural language processing (A):
Reinforcement learning (B):
Support vector machine (C):
Expert system (D):
Therefore, the correct option is A - III, B - I, C - IV, D - II. So, the correct option is 3).
Q11: Arrange the following stages of a Turing Machine (TM) operation in the correct order as they occur during computation.
(A) Writing a symbol on the tape
(B) Moving the tape head left to right
(C) Reading a symbol from the tape
(D) Transitioning to a new state based on the current state and symbol read
(E) Halting and accepting or rejecting the input
Choose the correct answer from the options given below:
(a) (C), (A), (B), (D), (E)
(b) (C), (B), (A), (D), (E)
(c) (C), (D), (A), (B), (E)
(d) (C), (D), (B), (A), (E)
Ans: C
Sol: The correct answer is (C), (D), (A), (B), (E).
Thus the correct answer is (C), (D), (A), (B), (E).
Other Related Points
Q12: Match List - I with List - II.
Choose the correct answer from the options given below:
(a) (A) - (II), (B) - (IV), (C) - (I), (D) - (III)
(b) (A) - (IV), (B) - (II), (C) - (III), (D) - (I)
(c) (A) - (II), (B) - (I), (C) - (IV), (D) - (III)
(d) (A) - (IV), (B) - (I), (C) - (II), (D) - (III)
Ans: C
Sol: The correct answer is A - II, B - I, C - IV, D - III
Therefore, the correct option is A - II, B - I, C - IV, D - III. So, the correct option is 3).
Q13: Arrange the following stages of parsing in the correct order as they typically occur in the compilation process.
(A) Lexical Analysis
(B) Semantic Analysis
(C) Syntax Analysis
(D) Intermediate Code Generation
(E) Code Optimization
Choose the correct answer from the options given below:
(a) (A), (B), (C), (D), (E)
(b) (A), (C), (B), (D), (E)
(c) (A), (D), (B), (C), (E)
(d) (A), (C), (D), (B), (E)
Ans: B
Sol: The correct answer is 2)(A), (C), (B), (D), (E).
Thus the correct answer is 2)(A), (C), (B), (D), (E).
Additional Information
Q14: How does a relational database ensure data integrity?
(a) By encrypting all data stored
(b) By enforcing rules defined in the schema
(c) By compressing data for efficient storage
(d) By allowing unrestricted access to all users
Ans: B
Sol: The correct answer is By enforcing rules defined in the schema
Other Related Points
Q15: Which of the following best describes the structure of a relational database?
(a) Data organized into tables with rows and columns
(b) Data organized into files and folders
(c) Data organized into a hierarchical tree structure
(d) Data organized into a network of interconnected nodes
Ans: A
Sol: The correct answer is Data organized into tables with rows and columns
Other Related Points
Q16:
#include <iostream>
using namespace std;
void swap(int &x, int &y) {
int temp = x;
x = y;
y = temp;
}
int main() {
int a = 5, b = 10;
swap(a, b);
swap(a, b);
cout << a << " " << b;
return 0;
}
What will be the output of above code?
(a) 5, 10
(b) 10, 5
(c) 5, 5
(d) 10, 10
Ans: A
Sol: Correct answer is 5, 10
Concept:
Pass by Reference:
In C++, when we pass variables by reference to a function, any modifications made to the parameters affect the original variables. This is useful for functions like swap, where we need to exchange the values of two variables.
Let's analyze the provided code step by step: #include using namespace std; void swap(int &x, int &y) { int temp = x; x = y; y = temp; } int main() { int a = 5, b = 10; swap(a, b); // First swap: a becomes 10, b becomes 5 swap(a, b); // Second swap: a becomes 5, b becomes 10 cout << a << " " << b; // Output the values of a and b return 0; }
Breakdown of the code:
1. Initially, `a` is 5 and `b` is 10.
2. The first `swap(a, b)` is called:
3. The second `swap(a, b)` is called:
4. Finally, the output will be:
Therefore, the output of the program will be: 1) 5, 10.
Q17: Which of the following are context free language?
(A) {wi xj yk zl| i + k = j + l, where i, j, k, l ≥ 0}
(B) {wi xj yk zl| i = j and k = l, where i, j, k, l ≥ 0}
(C) {wi xj yk zl| i = j = k and k ≠ l, where i, j, k, l ≥ 0}
(D) {wi xj yk zl| i = j = k + l, where i, j, k, l ≥ 0}
(E) {wi xj yk zl| i = j = l and k ≠ l, where i, j, k, l ≥ 0}
Choose the correct answer from the options given below:
(a) (A), (B) Only
(b) (B), (C) Only
(c) (C), (D) Only
(d) (D), (E) Only
Ans: A
Sol: The correct answer is (A), (B) Only
(A) {wi xj yk zl| i + k = j + l, where i, j, k, l ≥ 0} -
(B) {wi xj yk zl| i = j and k = l, where i, j, k, l ≥ 0} -
(C) {wi xj yk zl| i = j = k and k ≠ l, where i, j, k, l ≥ 0} -
(D){wi xj yk zl| i = j = k + l, where i, j, k, l ≥ 0} -
(E) {wi xj yk zl| i = j = l and k ≠ l, where i, j, k, l ≥ 0} -
Q18: What is the output of code given below:
#include<iostream>
using namespace std;
class Base {
public:
Base() {
cout << "Base Const";
}
virtual ~Base() {
cout << "Base dest";
}
};
class Derived : public Base {
public:
Derived() {
cout << "Derived Const";
}
~Derived() {
cout << "Derived dest";
}
};
int main() {
Base *b = new Derived();
delete b;
return 0;
}
(a) Base Const Derived Const Derived dest Base dest
(b) Base Const Derived Const Base dest Derived dest
(c) Derived Const Base Const Base dest Derived dest
(d) Base Const Derived Const Base dest
Ans: A
Sol: The correct answer is Base Const Derived Const Derived dest Base dest
Concept:
Virtual Destructor:
In C++, if a base class has a virtual destructor, the derived class destructors are also called when an object is deleted through a base class pointer. This ensures that the derived class resources are properly released. If the destructor is not virtual, only the base class destructor will be called, leading to resource leaks.
Let's analyze the provided code step by step to determine the output: #include using namespace std; class Base { public: Base() { cout << "Base Const"; } virtual ~Base() { cout << "Base dest"; } }; class Derived : public Base { // Note: The class declaration should be corrected here. public: Derived() { cout << "Derived Const"; } ~Derived() { cout << "Derived dest"; } }; int main() { Base *b = new Derived(); // Corrected from 'Base 'b=new Derived();' to 'Base *b = new Derived();' delete b; // This calls the destructor return 0; }
Breakdown of the code:
1. Object Creation:
2. Deletion:
Final Output Sequence:
Combining the outputs:
Thus, the complete output of the code will be: Base ConstDerived ConstDerived destBase dest
Therefore, the correct answer is: 1) Base Const Derived Const Derived dest Base dest
(However, note that in the output there would be no spaces unless added explicitly in the `cout` statements.)
Q19: Consider the transactions T1, T2, T3 and the schedules S1 and S2 given below.
T1 : r1(x); r1(z); w1(z)
T2 : r2(y); r2(z); w2(z)
T3 : r3(y); r3(x); w3(y)
S1 : r1(x); r3(y); r3(x); r2(y); r2(z); w3(y); w3(z); r1(z); w1(x); w1(z)
S2 : r1(x); r3(y); r2(y); r3(x); r1(Z); r2(z); w3(y); w1(x); w2(z); w1(z)
Which one of the following statements about the schedules is TRUE ?
(a) Only S1 is conflict-serializable
(b) Only S2 is conflict-serializable
(c) Both S1 and S2 are conflict-serializable
(d) Neither S1 nor S2 is conflict-serializable
Ans: A
Sol: The correct answer is Only S1 is conflict-serializable
Concept:
Schedule S1:
Precedence graph of S1:
Since there is no loop in S1, it is is conflict serializable
Order: T2 → T1 → T2
Schedule S2:
r1(X); r3(Y); r2(Y); r3(X); r1(Z); r2(Z); w3(Y); w1(X); w2(Z); w1(Z)
Precedence graph of S2:
Hence option 1 is the correct answer.
Q20: Consider the following code:
#include < stdio.h >
void f1(char *x, char *y) {
char *t1;
t1 = x;
x = y;
y = t1;
}
void f2(char *x, char *y) {
char *t1;
t1 = *x;
*x = *y;
*y = t1;
}
int main() {
char *a = "ONE", *b = "TWO";
f1(a, b);
printf("%s %s", a, b); // First output
f2(&a, &b);
printf("%s %s", a, b); // Second output
return 0;
}
What will be the output of the above code?
(a) ONE TWO TWO ONE
(b) TWO ONE ONE TWO
(c) ONE TWO ONE TWO
(d) TWO ONE TWO ONE
Ans: A
Sol: Concept:
Understanding Pointers and Function Calls in C:
In C programming, pointers are variables that store the memory address of another variable. When passing pointers to functions, it's essential to understand how the changes inside the function affect the original variables. We will discuss two types of functions:
Let's analyze the provided code step by step to determine its output: #include void f1(char *x, char *y) { char *t1; t1 = x; x = y; y = t1; } void f2(char *x, char *y) { char *t1; t1 = *x; *x = *y; *y = t1; } int main() { char *a = "ONE", *b = "TWO"; f1(a, b); printf("%s %s", a, b); // First output f2(&a, &b); printf("%s %s", a, b); // Second output return 0; }
Breakdown of the code:
1. Initialization:
2. Function `f1`:
3. Function `f2`:
4. Second Output:
Final Output:
Combining the results:
Therefore, the final output of the code will be:
ONE TWO
TWO ONE
Since this matches option 1) ONE TWO TWO ONE, the correct answer is 1) ONE TWO TWO ONE.
Q21: Which of the following statements about pointers in C are TRUE.
(A) Pointers can be used to access array elements
(B) Pointers can store the address of another pointer
(C) Pointers are automatically deferenced in expression
(D) Pointers cannot be used to access structure members
Choose the correct answer from the options given below:
(a) (A) and (C) Only
(b) (A) and (B) Only
(c) (B) and (C) Only
(d) (C) and (D) Only
Ans: B
Sol: The correct answer is 2)(A) and (B) Only
Q22: Which of the following are Agile Process Models?
(A) Extreme Programming (XP)
(B) Waterfall
(C) Scrum
(D) Spiral
(E) Incremental
Choose the correct answer from the options given below :
(a) (A) and (C) Only
(b) (B) and (C) Only
(c) (A) and (D) Only
(d) (B) and (E) Only
Ans: A
Sol: The correct answer is 1)(A) and (C) Only
Q23: Which of the following statements are TRUE about Mutual exclusion in concurrent programming?
(A) Mutual exclusion ensures that only one process can be in a critical section at any given time.
(B) Mutual exclusion are designed to prevent conflicts and ensure that only one process can access shared resources at a time.
(C) Mutual exclusion can use various algorithms to ensure that processes do not enter the critical section simultaneously.
(D) Mutual exclusion allows multiple processes to access the critical section simultaneously to improve performance.
Choose the correct answer from the options given below:
(a) (A), (B), (C) Only
(b) (B), (C), (D) Only
(c) (B), (D), (A) Only
(d) (A), (C), (D) Only
Ans: A
Sol: The correct answer is (A), (B), (C) Only
Q24: Match List - I with List - II.
Choose the correct answer from the options given below:
(a) (A) - (I), (B) - (II), (C) - (III), (D) - (IV)
(b) (A) - (I), (B) - (II), (C) - (IV), (D) - (III)
(c) (A) - (I), (B) - (III), (C) - (II), (D) - (IV)
(d) (A) - (I), (B) - (IV), (C) - (II), (D) - (III)
Ans: B
Sol: The correct answer is A - I, B - II, C - IV, D - III
Unit testing:
Integration testing:
System testing:
Acceptance testing:
Therefore, the correct option is A - I, B - II, C - IV, D - III. So, the correct option is 2).
Q25: Given a project with an estimated effort of 1500 person-hours and a team of 5 people, how many days will it take to complete the project, if each person works 8 hours a day?
(a) 30
(b) 37.5
(c) 40
(d) 45.5
Ans: B
Sol: Solution:
To calculate how many days it will take to complete the project, we can use the following steps:
Step 1: Calculate the total number of hours the team can work per day:
So, the total number of hours worked per day by the team is:
Step 2: Calculate the number of days required:
To find the number of days required, divide the total effort by the number of person-hours worked per day:
Answer: The project will take 37.5 days to complete.
So, the correct answer is: 2) 37.5.
Q26: Match List - I with List - II.
Choose the correct answer from the options given below:
(a) (A) - (II), (B) - (III), (C) - (IV), (D) - (I)
(b) (A) - (II), (B) - (IV), (C) - (III), (D) - (I)
(c) (A) - (III), (B) - (IV), (C) - (II), (D) - (I)
(d) (A) - (III), (B) - (IV), (C) - (I), (D) - (II)
Ans: C
Sol: The correct answer is A - III, B - IV, C - II, D - I
A. First Come First Served (FCFS) - III:
B. Shortest Job First (SJF) - IV:
C. Round Robin (RR) - II:
D. Priority Scheduling - I:
Therefore, the correct option is A - III, B - IV, C - II, D - I. So, the correct option is 3).
Q27: Host A (on TCP / IPv4 Networks) send an IP Datagram D to host B (also on TCP / IPv4 network). Assume that no error occured during transmission of D, when D reaches B. Which of following header field may differ from that of original datagram D?
(A) TTL
(B) Checksum
(C) Fragment offset
(D) Source IP
(E) Destination IP
Choose the correct answer from the options given below:
(a) (A) and (B) Only
(b) (A), (B) and (C) Only
(c) (A), (B), (C) and (D) Only
(d) (A), (B), (C) and (E) Only
Ans: B
Sol: The correct answer is (A), (B) and (C) Only
When an IP datagram is transmitted from Host A to Host B, some fields in the IP header may change, while others remain the same. Here's the breakdown of each field mentioned:
(A) TTL (Time-to-Live):
(B) Checksum:
(C) Fragment Offset:
(D) Source IP:
(E) Destination IP:
Thus, the correct answer is Option 2: (A), (B), and (C) Only.
Q28: Arrange the following steps in the correct order to solve the Knapsack problem using Dynamic Programming.
(A) Define the base case when the capacity is zero (0) or no items are left to consider
(B) Compute the maximum value that can be obtained using items up to the i-th item and a knapsack capacity of 0
(C) Identify subproblems and their dependencies based on items weights and values
(D) Initialize a table to store results of subproblems
(E) Iterate through each item and each possible Capacity to fill the table
Choose the correct answer from the options given below:
(a) (C), (D), (A), (E), (B)
(b) (D), (C), (A), (E), (B)
(c) (A), (C), (D), (E), (B)
(d) (D), (A), (C), (E), (B)
Ans: C
Sol: The correct answer is 3)(A), (C), (D), (E), (B).
Thus the correct answer is (A), (C), (D), (E), (B).
Other Related Points
Q29: Consider the three way hand shaking process followed during TCP connection establishment between two hosts A and B. Let S and R be two random 32 - bit starting sequence numbers chosen by A and B, respectively. Suppose A sends a TCP segment having SYN bit = 1, SEQ number = S and ACK bit=0 and B accepts the connection request.
Which one of the following choices represents the information present in the TCP segment header that is sent by B to A?
(a) SYN bit = 1, SEQ number = S + 1, ACK bit = 0, ACK number = R, FIN bit = 0
(b) SYN bit = 0, SEQ number = R, ACK bit = 1, ACK number = S + 1, FIN bit = 0
(c) SYN bit = 1, SEQ number = R, ACK bit = 1, ACK number = S + 1, FIN bit = 0
(d) SYN bit = 1, SEQ number = R, ACK bit = 1, ACK number = S, FIN bit = 0
Ans: C
Sol: The correct answer is SYN bit = 1, SEQ number = R, ACK bit = 1, ACK number = S + 1, FIN bit = 0
Concept:
Given:
Next segment will be a piggybacked Acknowledgement segment So Ack bit = 1 and Q will increment the Sequence number ( which it received from P) put this into Ack Number field. Syn = 1 as Q will also establish the connection from Q to P and Sequence number will be Y(As given in Question).
So , SYN bit = 1 SEQ Number = Y ACK bit = 1 ACK number = X+1 FIN bit = 0. Matches with Option 3.
Q30: Match List - I with List - II.
Choose the correct answer from the options given below:
(a) (A) - (I), (B) - (II), (C) - (III), (D) - (IV)
(b) (A) - (II), (B) - (III), (C) - (IV), (D) - (I)
(c) (A) - (III), (B) - (I), (C) - (IV), (D) - (II)
(d) (A) - (III), (B) - (IV), (C) - (II), (D) - (I)
Ans: C
Sol: The correct answer is A - III, B - I, C - IV, D - II
Cohesion (A):
Coupling (B):
Abstraction (C):
Modularity (D):
Therefore, the correct option is A - III, B - I, C - IV, D - II. So, the correct option is 3).
Q31: Consider following C program:
#include < stdio.h >
int main()
{
int x[] = {2, 4, 6, 8, 10};
int a, b = 0, *y = x + 4;
for(a = 0; a < 5; a++)
{
b = b + (*y - a) - *(y - a);
}
printf("%d\n", b);
return 0;
}
What will be the output of the above C program?
(a) 4
(b) 6
(c) 8
(d) 10
Ans: A
Sol: The correct answer is 10
Concept:
In C programming, the comma operator (`,`) is used to separate two or more expressions that are included where only one expression is expected. The comma operator evaluates each of its operands (from left to right) and returns the value of the last operand.
In the code `int x[] = {2, 4, 6, 8, 10};`, the values inside curly brackets are evaluated and the last value `10` is assigned to the first element of the array `x`.
-
Given the corrected code:
#include < stdio.h > int main() { int x[] = {2, 4, 6, 8, 10}; int a, b = 0, *y = x + 4; for(a = 0; a < 5; a++) { b = b + (*y - a) - *(y - a); } printf("%d\n", b); return 0; }
int x[] = {2, 4, 6, 8, 10};
initializes the array x
.int a, b = 0, y = x + 4;
initializes a
, b
to 0, and y
to point to the address of the 5th element of array x
(i.e., x[4]
which is 10).The for loop runs from a = 0
to a < 5
:
*y
is 10
(value at x[4]
).y - a
points to different elements of x
as a
varies from 0 to 4.The expression b + (*y - a) - *(y - a) simplifies to 0 for every iteration:
Final Output: After the loop, the final value of b is printed10
Hence the correct answer is: 10
Q32: Which of the following statements are TRUE about Privileged Instructions ?
(A) It can only be executed by the Operating System kernel and not by user applications.
(B) It is designed to perform operations that can directly affect the hardware or system state such as I/O operations or changing memory management settings.
(C) User applications can execute privileged instructions if they have to the correct permissions, set by the Operating System.
(D) It is usually executed in user mode to ensure the safety and security of the system.
Choose the correct answer from the options given below:
(a) (A) and (B) Only
(b) (A), (B) and (C) Only
(c) (B) and (C) Only
(d) (B), (C) and (D) Only
Ans: A
Sol: The correct answer is 1)(A) and (B) Only
(A) It can only be executed by the Operating System kernel and not by user applications. -
(B) It is designed to perform operations that can directly affect the hardware or system state such as I/O operations or changing memory management setting. -
(C) User applications can execute privileged instructions if they have the correct permissions, set by the Operating System. -
(D) It usually executed in user mode to ensure the safety and security of the system. -
Q33: Which of the following are typical activities in the software process lifecycle ?
(A) Requirement Analysis
(B) System Design
(C) Code Refactoring
(D) Deployment
(E) Substructure
Choose the correct answer from the options given below :
(a) (A), (B), (C) Only
(b) (B), (C), (D) Only
(c) (A), (B), (D) Only
(d) (A), (D), (E) Only
Ans: C
Sol: The correct answer is (A), (B), (D) Only
(A) Requirement Analysis -
(B) System Design -
(C) Code Refactoring -
(D) Deployment -
(E) Substructure -
Q34: Match List - I with List - II.
Choose the correct answer from the options given below:
(a) (A) - (III), (B) - (IV), (C) - (I), (D) - (II)
(b) (A) - (III), (B) - (IV), (C) - (II), (D) - (I)
(c) (A) - (IV), (B) - (III), (C) - (II), (D) - (I)
(d) (A) - (IV), (B) - (III), (C) - (I), (D) - (II)
Ans: D
Sol: The correct answer is A - IV, B - III, C - I, D - II
Solution Statement
A. A bag contains 6 white and 4 red balls. Two balls are drawn at random. What is the chance, they will be the same colour?
B. In a pack of 52 cards, one card is drawn at random, what is the probability that it is either a king or a queen?
C. A bag contains 6 red, 4 white and 8 blue balls. If three balls are drawn at random, find the probability of 1 red and 2 white balls?
D. A bag contains 6 red, 4 white and 8 blue balls. If three balls are drawn at random. Find the probability of 2 blue and 1 red balls?
Therefore, the correct option is A - IV, B - III, C - I, D - II. So, the correct option is 4).
Q35: Select the Sorting Algorithms that are stable.
(A) Quick Sort
(B) Bubble Sort
(C) Insertion Sort
(D) Merge Sort
(E) Shell Sort
Choose the correct answer from the options given below:
(a) (A), (B), (C) and (E) Only
(b) (A), (D) and (E) Only
(c) (B) and (C) Only
(d) (B), (C) and (E) Only
Ans: C
Sol: The correct answer is (B) and (C) Only
(A) Quick Sort -
(B) Bubble Sort -
(C) Insertion Sort -
(D) Merge Sort -
(E) Shell Sort -
Q36: Which of the following is correct way to declare a functional pointer in C?
(a) int *func (int, int);
(b) int (*func) (int, int);
(c) int (func*) (int, int);
(d) int *func* (int, int);
Ans: B
Sol: The correct answer is int (*func) (int, int);
To declare a function pointer in C, the correct syntax must be followed. A function pointer is a variable that stores the address of a function, and the declaration involves specifying the return type of the function, the pointer itself, and the types of its parameters.
Analyzing the Options:
int *func (int, int);
int (*func) (int, int);
int (func*) (int, int);
int *func* (int, int);
Conclusion: The correct way to declare a function pointer in C is: 2) int (*func) (int, int);.
Q37: A coin is tossed successively three times. Find the Probability (P), Event (E), Sample space (S) of getting exactly one head or two heads, where n is number of occurrence.
(A) n(S) = 8 and n(E) = 4
(B) n(E) = 6 and n(S) = 8
(C) P(E) = 3/4
(D) P(E) = 1/2
Choose the correct answer from the options given below:
(a) (A), (B), (C) and (D)
(b) (B) and (C) Only
(c) (A) and (D) Only
(d) (C) and (D) Only
Ans: B
Sol: The correct answer is 2)(B) and (C) Only
Let's first understand the problem:
A coin is tossed successively three times. We need to find the Probability (P), Event (E), and Sample space (S) of getting exactly one head or two heads, where n is the number of occurrences.
Sample Space (S):The sample space for tossing a coin three times is given by the set of all possible outcomes:
Event (E):The event of getting exactly one head or two heads includes the following outcomes:
Probability (P):The probability of an event is given by the ratio of the number of favorable outcomes to the total number of possible outcomes:
Now, let's evaluate the options:
(A) n(S) = 8 and n(E) = 4 -
(B) n(E) = 6 and n(S) = 8 -
(C) P(E) = 3/4 -
(D) P(E) = 1/2 -
Q38: Consider the Grammar:
S → A
A → $B$ | id
B → B, A | A
If I0 = CLOSURE ({[S → .A]}) then, how many items be in the set for GOTO(I0, $)
(a) 3
(b) 4
(c) 5
(d) 6
Ans: C
Sol: The correct answer is 5
To determine how many items will be in the set for GOTO(I0, $) given the grammar:
Grammar:
1. S → A
2. A → $B$
3. A → id
4. B → B, A
5. B → A
Step 1: Compute the CLOSURE of I0 = CLOSURE({[S → .A]})
The initial item set I0 consists of the item [S → .A] .
Applying the Closure:
1. From S → .A , we look for productions for A :
A → $B$
A → id
So, we add:
[A → $B$]
[A → id]
2. We also have B productions, since B can be derived from A :
B → B, A
B → A
Thus, the closure will contain the following items:
Closure Result:
Step 2: Compute GOTO(I0, $)
Now we compute GOTO(I0, $) .
For each item in I_0 :
1. Item: [S → .A]
This item has the dot before A , and since we are doing GOTO(I0, $) , we look for a production that has A followed by a $.
2. Item: [A → $B$]
This item is already at $, and it does not produce anything new.
3. Item: [A → id]
This item does not contain any $.
4. Item: [B → B, A]
This item does not contain any $.
5. Item: [B → A]
This item does not contain any $.
The only transition will happen from the first item:
Conclusion for GOTO(I0, $) :
Resulting Items in GOTO Set:
This retains the closure set yet leading us to assess from the transitions that all items still remain as is thus maintaining a total of 5 items.
Final Answer: The correct answer is 3) 5.
Q39: Consider a relation schema R = (U, V, W, X, Y, Z), on which the following functional dependencies hold:
(U → V, VW → X, Y → W; X → U}
The candidate keys of R are:
(a) UY, VY
(b) UY, VY, XY
(c) UYZ, VYZ, VWZ
(d) UYZ, VYZ, XYZ
Ans: D
Sol: The correct answer is UYZ, VYZ, XYZ
Concept:
A candidate key is a column, or set of columns, in a table that can uniquely identify any database record without referring to any other data
The following functional dependencies,
U → V, VW → X, Y → W, X → U
S = (U, V, W, X, Y, Z)
Here YZ is an independent key. So, for every key, the YZ should their. Hence only option 4 is containing YZ for all keys.
∴ Hence the correct answer is UYZ, VYZ, XYZ.
Alternate Method
Options Verify:
Q40: In a schema R(A, B, C, D, E, F, G, H), each field of R contains only atomic values.
F = (CH → G, A → BC, B → CFH, E → A, F → EG) is a set of functional dependencies so that F + is exactly the set of FDs that holds R. The relation R is :
(a) In 1NF, but not in 2NF
(b) In 2NF, but not in 3NF
(c) In 3NF, but not in BCNF
(d) In BCNF
Ans: A
Sol: The correct answer is In 1NF, but not in 2NF.
CONCEPT:
A set of attributes that uniquely identify tuples in a table is called the Candidate key.
Candidate keys may have multiple attributes.
A functional dependency is a relationship or dependency that exists between two attributes.
Closure means the complete set of all possible attributes that can be functionally derived from the functional dependencies.
Normalization is used to minimize redundancy from a set of relations.
It is used to organize data effectively in the database.
Normal forms are used to reduce redundancy from the database.
According to the given dependencies,
CH → G
A → BC
B → CFH
E → A
F → EG
Since D is not part of any functional dependency so it can be a candidate key or maybe part of a candidate key.
To find more candidate keys add A, B, C, D, E, G, and H to D & find its closure:
(AD)+ = {ABCDEFGH}
(BD)+ = {ABCDEFGH}
(CD)+ = {CD}
(ED)+ = {ABCDEFGH}
(FD)+ = {ABCDEFGH}
(GD)+ = {GD}
(HD)+ = {HD}
Since AD, BD, ED & FD gives all attributes, so they are candidate keys.
But the dependencies,
A → BC, B → CFH, and F → EG are partial dependencies.
{Here C, G, H are non-key attributes.}
Hence, the given relation is in 1NF but not in 2NF.
Q41: Let L (x, y) be the statement "x loves y" where the domain for both x and y consists of all people in the world. Use quantifiers to express "Joy is loved by everyone".
(a) ∀x L(x, Joy)
(b) ∀y L(Joy, y)
(c) ∃y∀x L(x, y)
(d) ∃x¬ L(Joy, x)
Ans: A
Sol: The correct answer is ∀x L(x, Joy)
To express the statement "Joy is loved by everyone" using quantifiers and the given predicate L(x, y) (where L(x, y) means "x loves y"), we want to convey that for every person x , that person loves Joy.
This can be expressed using the universal quantifier as follows: 1) ∀x L(x, Joy)
This translates to: "For every person x , x loves Joy," which accurately captures the intended meaning that everyone loves Joy.
Thus, the correct answer is: 1)∀x L(x, Joy) .
Q42: Consider the Grammar:
T → Qx
Q → RS
R → y|ε
S → z|ε
Here x, y, z are terminals and T, Q, R, S are non terminals. What will be the follow set of the non terminal R?
(a) {x, y}
(b) {y, z}
(c) {z, x}
(d) {ε}
Ans: C
Sol: The correct answer is {z, x}
To find the Follow set of the non-terminal R in the given grammar, we will analyze the production rules.
Grammar:
1. T → Qx
2. Q → RS
3. R → y | ϵ
4. S → z | ϵ
Step 1: Identify the rules involving R
From the production Q → RS :
Step 2: Determine Follow set of R
1. Check the Follow of Q :
2. From Q → RS :
Step 3: Determine Follow of S
1. Check the productions for S :
2. Follow of S :
Step 4: Combine results for R
Since S can produce ϵ :
Final Step: Conclusion
Combining all the above information, the Follow set of R is: Follow(R) = {z, x}
However, since R produces y (and indirectly through Q ), and because R is followed by S which can produce ϵ , we include z in Follow of R .
Thus, the correct answer is: 3) {z, x}
Q43: Consider the following statements regarding combinational and sequential circuits.
(A) Output of combinational circuits depends on the only current input.
(B) Output of combinational circuit depends on both current input and previous output.
(C) Output of sequential circuit depends on the current input.
(D) Output of sequential circuit depends on both current input and previous output.
Choose the correct answer from the options given below:
(a) (A) and (C) Only
(b) (A) and (D) Only
(c) (B) and (D) Only
(d) (B) and (C) Only
Ans: B
Sol: The correct answer is 2) (A) and (D) Only
(A) Output of combinational circuits depends on the only current input. -
(B) Output of combinational circuit depends on both current input and previous output. -
(C) Output of sequential circuit depends on the current input. -
(D) Output of sequential circuit depends on both current input and previous output. -
Q44: A CPU has a 5-stage pipeline with the following stages Fetch (F), Decode (D), Execute (E), Memory (M) and Write-back (W). Each stage takes one clock cycle to complete. Assume there are no pipeline stalls and the pipeline is initially empty. How many clock cycles are required to complete the execution of 10 instructions?
(a) 10
(b) 14
(c) 15
(d) 19
Ans: B
Sol: Solution:
In a pipelined CPU with 5 stages (Fetch, Decode, Execute, Memory, and Write-back), the execution of instructions is overlapped. Once the pipeline is filled, each new instruction can be completed in just one clock cycle.
Let's break down the process:
1. The first instruction takes 5 clock cycles to complete, as each of the 5 stages (F, D, E, M, W) must be processed sequentially.
2. After the pipeline is filled, every subsequent instruction will be completed in 1 additional clock cycle because the stages work in parallel.
For 10 instructions:
Thus, the total number of clock cycles required is:
Therefore, the total number of clock cycles required to complete the execution of 10 instructions is 14 cycles.
Q45: (A) In IPv4 addressing, a block of address can be defined as x.y.z.t / n in which x.y.z.t define one of the addresses and / n define the mask
(B) The first address in the block can be found by setting the rightmost 32-n bits to 0s
(C) addresses of class C is used for multicast communication
(D) There are five classes in IPv4 addresses
(E) Supernetting combine several networks into one large network
Choose the correct answer from the options given below:
(a) (A), (B) and (C) Only
(b) (A), (B), (D) and (E) Only
(c) (A), (C), (D) and (E) Only
(d) (C), (D) and (E) Only
Ans: B
Sol: The correct answer is 2)(A), (B), (D) and (E) Only
(A) In IPv4 addressing,a block of address can be defined as x.y.z.t / n in which x.y.z.t defines one of the addresses and / n defines the mask.-
(B) The first address in the block can be found by setting the rightmost 32-n bits to 0s. -
(C) addresses of class C is used for multicast communication. -
(D) There are five classes in IPv4 address. -
(E) Supernetting combines several networks into one large network. -
Q46: Consider a CSMA/CD network that transmits data at the rate of 100 Mbps over a 1 Kilometre cable with no repeater. If the minimum frame size required for this network is 1250 bytes, what is the signal speed (km/sec) in the cable.
(a) 8000
(b) 16000
(c) 12000
(d) 20000
Ans: D
Sol: Key Points
Given data,
Band width = B = 100 Mbps =108 bps
Distance = D = 1 koilometer
Frame length = L = 1250 bytes
Speed = S =?
Important Points
A minimum frame length for CSMA/CD protocol will be Tx=2 Tp
Here Tx = transmission delay = Frame length / Bandwidth = L/B
Tp = propagation delay = Distance / speed of signal = D/S
Calculation:
A minimum frame length for CSMA/CD protocol will be Tx= 2 Tp
Hence the correct answer is 20000.
Q47: What is SQL primarily used for in the context of relational databases ?
(a) To design user interfaces
(b) To create and manipulate databases
(c) To display data on web pages
(d) To format printed reports
Ans: B
Sol: The correct answer is To create and manipulate databases
SQL is the standard language for interacting with relational databases. It is used for:
Other Related Points
Q48: Given a project that uses the COCOMO model with an estimated effort of 2000 person-months and a productivity rate of 5 person-month per KLOC, what is the estimated size of the project in KLOC?
(a) 200
(b) 400
(c) 100
(d) 50
Ans: B
Sol: To estimate the size of the project in KLOC (Kilo Lines of Code) using the COCOMO model, you can use the following formula:
Given:
Substitute the values:
Thus, the estimated size of the project is 400 KLOC.
Q49: _________ is a Self Balancing binary search tree, where the path from the root to the furthest leaf is no more than twice as long as the path from the root to nearest leaf.
(a) Expression tree
(b) Game tree
(c) Red-Black tree
(d) Threaded tree
Ans: C
Sol: The correct answer is Red-Black tree
Other Related Points
Q50: Arrange the following phases of the Agile process in the correct sequence:
(A) Design
(B) Release
(C) Testing
(D) Development
(E) Planning
Choose the correct answer from the options given below :
(a) (A), (B), (D), (E), (C)
(b) (A), (D), (E), (B), (C)
(c) (E), (A), (D), (C), (B)
(d) (E), (D), (A), (C), (B)
Ans: C
Sol: The correct answer is 3)(E), (A), (D), (C), (B).
Thus the correct answer is 3)(E), (A), (D), (C), (B).
Other Related Points
Q51: Which of the following statements are TRUE about Process Control Block (PCB)?
(A) The PCB contains information about the process state, such as whether it is running, waiting or terminated
(B) The PCB includes the program code and data segments of the process
(C) The PCB stores the process's memory management information, such as page tables and segment tables
(D) The PCB is used to track process scheduling information and CPU registers for process execution
Choose the correct answer from the options given below:
(a) (A), (B) and (C) Only
(b) (B), (C) and (D) Only
(c) (A), (C) and (D) Only
(d) (A) and (B) Only
Ans: C
Sol: The correct answer is (A), (C) and (D) Only
(A) The PCB contains information about the process state, such as whether it is running, waiting or terminated. -
(B) The PCB includes the program code and data segments of the process. -
(C) The PCB stores the process's memory management information, such as page tables and segment tables. -
(D) The PCB is used to track process scheduling information and CPU registers for process execution. -
Q52: Which of the following tasks could be attained using syntax trees in compiler design?
(A) Type Checking
(B) Code Generation
(C) Code Optimization
(D) Error Handling
Choose the correct answer from the options given below:
(a) (A), (B), (C) Only
(b) (B), (C), (D) Only
(c) (A), (C), (D) Only
(d) (A), (B), (D) Only
Ans: A
Sol: The correct answer is 1)(A), (B), (C) Only
(A) Type Checking -
(B) Code Generation -
(C) Code Optimization -
(D) Error Handling -
Q53: In a token ring network the transmission speed is 107 bps and the propagation speed is 200 m/μs. The 1-bit delay in this network is equivalent to ________.
(a) 20 m
(b) 30 m
(c) 50 m
(d) 40 m
Ans: A
Sol: The correct answer is 20 m
Solution:
To determine the 1-bit delay in a token ring network, we can use the following formula:
Given Data:
Transmission Speed = 107 bps (bits per second)
Propagation Speed = 200 m/μs (meters per microsecond)
Step 1: Calculate the time taken to transmit 1 bit
Step 2: Calculate the distance that light (or the signal) travels in that time
Using the propagation speed, we can calculate the distance:
Convert the propagation speed into meters per second for consistency:
Now, calculate the distance for 9.345 ms (which is 0.009345 seconds):
Step 3: However, since we are interested in the 1-bit delay specifically, we refer to the delay distance based on the propagation time per bit:
Using the propagation speed directly:
Since the transmission time for 1 bit is \frac{1}{107} seconds, we directly calculate the distance:
This means that every bit of data takes 1 bit delay to travel this distance in a 1-bit time, which we translate into distance terms relevant to our initial options.
Conclusion:
Since the exact numerical propagation per bit is not calculable via our earlier method due to dimensional conversion, we could intuitively guess:
Hence, the answer is 1) 20 m.
Q54: Let G(V, E) be an undirected graph with l edges. Then the sum of degree of all vertices is equal to ________.
(a) 2l
(b) l/2
(c) l2
(d) √I
Ans: A
Sol: The correct answer is 2l
In an undirected graph G(V, E) , the degree of a vertex is defined as the number of edges incident to that vertex.
The Handshaking Lemma:
According to the Handshaking Lemma in graph theory, the sum of the degrees of all vertices in an undirected graph is equal to twice the number of edges. This is because each edge contributes to the degree of two vertices.
Conclusion:
Therefore, the correct answer is: 1) 2l
Q55: Match List - I with List - II.
Choose the correct answer from the options given below:
(a) (A) - (II), (B) - (III), (C) - (I), (D) - (IV)
(b) (A) - (I), (B) - (IV), (C) - (II), (D) - (III)
(c) (A) - (I), (B) - (II), (C) - (IV), (D) - (III)
(d) (A) - (III), (B) - (IV), (C) - (II), (D) - (I)
Ans: D
Sol: The correct answer is A - III, B - IV, C - II, D - I
10.20.30.40 (A):
210.20.30.3 (B):
180.30.100.10 (C):
252.5.15.11 (D):
Therefore, the correct option is A - III, B - IV, C - II, D - I. So, the correct option is 4).
Q56: Consider the following if p and q are two statements.
(A) ~(p∧q) ≡ ~p∨~q
(B) ~(p∨q) ≡ ~p∧~q
(C) p∧~p ≡ T
(D) (p ⇒ q) ≡ p∧~q
(E) p∨q ≡ ~p∨~q
Choose the correct answer from the options given below :
(a) (A), (B) and (D) Only
(b) (A), (C) and (D) Only
(c) (C), (D) and (E) Only
(d) (A), (B) only
Ans: D
Sol: The correct answer is Option 4) (A), (B) only
Correct Logical Equivalences:
Therefore, the correct answer is: Option 4) (A), (B) only
Q57: Arrange the following recurrence relations in increasing order of their time complexity.
(A) T(n) = T(n/2) + 1
(B) T(n) = 2T(n/2) + n
(C) T(n) = 3T(n/3) + n
(D) T(n) = 2T(n/2) + √n
(E) T(n) =T(n - 1) + 1
Choose the correct answer from the options given below:
(a) (E), (A), (B), (D), (C)
(b) (A), (E), (D), (B), (C)
(c) (E), (A), (D), (B), (C)
(d) (A), (B), (D), (E), (C)
Ans: B
Sol: The correct answer is (A), (E), (D), (B), (C)
Thus the correct answer is (A), (E), (D), (B), (C)
Other Related Points
Q58: Which of the following languages can be recognized by Pushdown Automata(PDA) but cannot be recognized by Deterministic Finite Automata (DFA)?
(A) L1 = (w∈ {0, 1}*| the length of w is even}
(B) L2 = (w∈ {0, 1}*| the length of w is odd}
(C) L3 = (w∈ (0, 1)*| all 0's come before all I's in w}
(D) L4 = (w∈ {0, 1}*| w contains an equal number of 0's and 1's}
(E) L5 = (w∈ {0, 1}*| all 1's come before all 0's in w}
Choose the correct answer from the options given below:
(a) (A) and (B) Only
(b) (B) and (C) Only
(c) (D) Only
(d) (D) and (E) Only
Ans: C
Sol: The correct answer is (D) Only
L1 = {w ∈ {0, 1}* | the length of w is even}
L2 = {w ∈ {0, 1}* | the length of w is odd}
L3 = {w ∈ {0, 1}* | all 0's come before all 1's in w}
L4 = {w ∈ {0, 1}* | w contains an equal number of 0's and 1's}
L5 = {w ∈ {0, 1}* | all 1's come before all 0's in w}
Thus, the language L4 is the only one that can be recognized by a PDA but not by a DFA, making the correct answer (3) (D) Only.
Q59: Arrange the following steps in a proper sequence for the typical process of a DNS query:
(A) Query authoritative DNS Server
(B) Query local DNS Server
(C) Local DNS Server Check Cache
(D) Query root DNS Server
(E) Query TLD DNS Server
Choose the correct answer from the options given below:
(a) (A), (C), (E), (B), (D)
(b) (E), (A), (C), (B), (D)
(c) (A), (B), (C), (D), (E)
(d) (B), (C), (D), (E), (A)
Ans: D
Sol: The correct answer is (B), (C), (D), (E), (A).
Thus the correct answer is (B), (C), (D), (E), (A).
Other Related Points
Q60: Consider the function in C code:
void Cal(int a, int b) {
if (b != 1) {
if (a != 1) {
printf("*");
Cal(a / 2, b);
} else {
b = b - 1;
Cal(10, b);
}
}
}
How many times is going to be printed, if the function is called with Cal(10, 10); ?
(a) 25
(b) 23
(c) 24
(d) 27
Ans: D
Sol: The correct answer is 27
Concept:
In this problem, we are dealing with a recursive function in C that prints a '*' character based on certain conditions. Understanding the flow of recursive calls and how the parameters change is crucial to solving this problem.
Consider the function in the provided C code:
void Cal(int a, int b) { if (b != 1) { if (a != 1) { printf("*"); Cal(a / 2, b); } else { b = b - 1; Cal(10, b); } } }
Let's trace the function call Cal(10, 10);
:
1. Cal(10, 10);
- Since b != 1
and a != 1
, it prints '*' and calls Cal(5, 10);
2. Cal(5, 10);
- Again, b != 1
and a != 1
, it prints '*' and calls Cal(2, 10);
3. Cal(2, 10);
- Again, b != 1
and a != 1
, it prints '*' and calls Cal(1, 10);
4. Cal(1, 10);
- Here, a == 1
, so it decrements b
to 9 and calls Cal(10, 9);
The process repeats with Cal(10, 9);
similarly, and continues reducing the value of b
by 1 each time a
becomes 1, until eventually b
becomes 1. For each b
value from 10 down to 2, the function makes three recursive calls (dividing a
by 2 each time until a == 1
) and prints '*' three times.
So, the number of '*' printed can be calculated as: 3 (for b = 10
) + 3 (for b = 9
) + ... + 3 (for b = 2
) = 9 * 3 = 27.
Hence, the correct answer is 27.
Q61: Which of the following C++ statements correctly declares an abstract class?
(a) class A { virtual void show() = 0; };
(b) class A { void show() = 0; };
(c) class A { void show() {}; }
(d) class A { show() = 0; };
Ans: A
Sol: The correct answer is class A { virtual void show() = 0; };
To declare an abstract class in C++, you need to use at least one pure virtual function. A pure virtual function is declared by appending = 0 to the function declaration within the class.
Conclusion:
The correct statement that declares an abstract class is: 1) class A { virtual void show() = 0; };
Q62: Arrange the given steps required for a Direct Memory Access (DMA) transfer in the correct order.
(A) Initiate DMA transfer request
(B) Transfer data directly between peripheral and memory
(C) Processor grants DMA control over the system bus
(D) DMA controller completes data transfer and signals completion
Choose the correct answer from the options given below:
(a) (C), (A), (B), (D)
(b) (A), (C), (B), (D)
(c) (A), (B), (C), (D)
(d) (C), (B), (A), (D)
Ans: B
Sol: The correct answer is (A), (C), (B), (D).
Thus the correct answer is (A), (C), (B), (D).
Other Related Points
Q63: In Software configuration management, what is the primary purpose of version control?
(a) To control the changes made to software
(b) To document user requirements
(c) To estimate project cost
(d) To design the software architecture
Ans: A
Sol: The correct answer is To control the changes made to software
Other Related Points
Q64: Arrange the following steps of Feature Driven Development (FDD) process in the correct sequence:
(A) Develop an overall model
(B) Build by feature
(C) Plan by feature
(D) Design by feature
(E) Build a feature list
Choose the correct answer from the options given below:
(a) (A), (C), (B), (E), (D)
(b) (A), (E), (C), (D), (B)
(c) (B), (A), (D), (E), (C)
(d) (A), (B), (C), (E), (D)
Ans: B
Sol: The correct answer is (A), (E), (C), (D), (B).
Thus the correct answer is (A), (E), (C), (D), (B).
Other Related Points
Q65: Match List - I with List - II.
Choose the correct answer from the options given below:
(a) (A) - (I), (B) - (IV), (C) - (III), (D) - (II)
(b) (A) - (IV), (B) - (II), (C) - (I), (D) - (III)
(c) (A) - (I), (B) - (III), (C) - (IV), (D) - (II)
(d) (A) - (III), (B) - (I), (C) - (IV), (D) - (II)
Ans: C
Sol: The correct answer is A - I, B - III, C - IV, D - II
T(n) = 2T(n/2) + n:
T(n) = T(n/2) + 1:
T(n) = 2T(n/2) + 1:
T(n) = T(n - 1) + 1:
Therefore, the correct option is A - I, B - III, C - IV, D - II. So, the correct option is 3).
Q66: Translate ∀x∃y(x < y) in English. Consider domain as a real number for both the variables.
(a) For all real numbers x, there exists a real number y such that x is less than y
(b) For every real number y. there exists a real number x such that x is less than y
(c) For some real numbers x, there exists a real number y such that x is less than y
(d) For each and every real numbers x and y, x is less than y
Ans: A
Sol: The correct answer is For all real numbers x, there exists a real number y such that x is less than y
The expression ∀x∃y(x < y) can be translated into English as follows:
Putting it all together, the correct translation is: 1) For all real numbers x , there exists a real number y such that x is less than y.
Q67: Consider a schema R(P,Q,R,S) and the following functional dependencies P → Q, Q → R, R → S, S → Q. Then decomposition of R1 (P, Q), R2 (Q, R) and R3 (Q, S) is :
(a) Dependency Preserving and lossless join
(b) Lossless Join but not dependency preserving
(c) Dependency preserving but not lossless Join
(d) Not dependency preserving and not lossless join
Ans: A
Sol: The correct answer is Dependency Preserving and lossless join
For this decomposition of R into R1 (P, Q), R2 (Q, R) and R3(Q, S) using the given functional dependencies, two conditions are checked:
So, this decomposition is both a lossless join and dependency preserving. Hence, option 1) "Dependency preserving and lossless join".
Q68: Which of the following relations can not be decomposed in to BCNF with a lossless join and dependency-preserving decomposition ?
(a) R (V, W, X, Y, Z) (VW → X, WX → V, VX → W, W → Y, Y → Z)
(b) R (V, W, X, Y) {VW → W, X → Y}
(c) {VW → X, X → VY}
(d) R (V, W, X, Y, Z) (VW → X, X → Y, Y → Z, Z → V}
Ans: C
Sol: The correct answer is: Option 3
Concept:
Boyce-Codd Normal Form (BCNF) is a higher version of the Third Normal Form (3NF). A relation is in BCNF if for every non-trivial functional dependency X → Y
, X
is a super key.
While BCNF decomposition always guarantees a lossless join, it does not always guarantee dependency preservation.
Option 1: R(V, W, X, Y, Z) with FDs:
Observation: This is a known example from textbooks like Navathe and Korth that looks complex, but it can be decomposed into BCNF with both lossless join and dependency preservation.
Why it is NOT the correct answer: Despite multiple dependencies, by carefully selecting decompositions (e.g., starting from W → Y), we can achieve both BCNF and preserve dependencies.
Observation: The FD VW → W is trivial and doesn't affect BCNF. The FD X → Y violates BCNF if X is not a superkey.
Decomposition:
This decomposition is:
Why it is NOT the correct answer: It can be decomposed into BCNF with both lossless join and dependency preservation.
Candidate Key: VW (since VW⁺ = V, W, X → V, W, X, Y = all attributes)
Violation: FD X → VY is a violation of BCNF as X is not a superkey
Attempted BCNF Decomposition:
Check:
Why this IS the correct answer: This relation cannot be decomposed into BCNF while preserving both lossless join and dependencies.
Observation: This is a cyclic chain of dependencies. These types of chains can be decomposed incrementally in BCNF.
Possible decomposition:
Lossless Join: ✅
Dependency Preservation: ✅ All dependencies are represented in individual decomposed relations
Why it is NOT the correct answer: It can be decomposed into BCNF with both properties preserved.
Final Answer: Option 3 is the correct answer because it cannot be decomposed into BCNF with both lossless join and dependency preservation.
Q69: Match List - I with List - II.
Choose the correct answer from the options given below:
(a) (A) - (II), (B) - (I), (C) - (III), (D) - (IV)
(b) (A) - (II), (B) - (I), (C) - (IV), (D) - (III)
(c) (A) - (I), (B) - (II), (C) - (III), (D) - (IV)
(d) (A) - (III), (B) - (II), (C) - (IV), (D) - (I)
Ans: B
Sol:
Dijkstra's Algorithm:
Floyd-Warshall Algorithm:
Bellman-Ford Algorithm:
Prim's Algorithm:
Therefore, the correct option is A - II, B - I, C - IV, D - III. So, the correct option is 2).
Q70: Match List - I with List - II.
Choose the correct answer from the options given below:
(a) (A) - (II), (B) - (IV), (C) - (III), (D) - (I)
(b) (A) - (IV), (B) - (III), (C) - (II), (D) - (I)
(c) (A) - (II), (B) - (I), (C) - (IV), (D) - (III)
(d) (A) - (III), (B) - (IV), (C) - (II), (D) - (I)
Ans: C
Sol: The correct answer is A - II, B - I, C - IV, D - III
A. The activation function:
B. The learning method of perceptron:
C. Areas of application of artificial neural network include:
D. The output of the perceptron:
Therefore, the correct option is A - II, B - I, C - IV, D - III. So, the correct option is 3).
Q71: #include <stdio.h>
void main()
{
int arr[] = {1, 2, 3, 4, 5};
int *p = arr;
printf("%d", *p++);
printf("%d", *(p + 1));
}
Find the output of the above code?
(a) 1, 2
(b) 1, 3
(c) 2, 3
(d) 1, 4
Ans: B
Sol: The correct answer is 1, 3
Concept:
Understanding *p++:
This is a combination of dereferencing and post-increment. First, the value pointed to by `p` is used, and then `p` is incremented. This means that the initial value pointed to by `p` (which is `arr[0]` or `1`) is used in the expression, and then `p` is incremented to point to the next element of the array (`arr[1]`).
Understanding *(p + 1):
This expression adds 1 to the pointer `p`, but does not change the value of `p`. Instead, it returns the address of the element that is one position ahead of the current element pointed to by `p`. Therefore, `p + 1` points to `arr[2]` after the increment operation in Line 1.
Let's break down the code step by step:
Step 1:
Line 1:
Step 2:
Line 2:
Hence the correct answer is:
The output of the above code is 1, 3.
Q72: Consider the given number (45)y where y is the base of the number. Some of the possible values of y are given below.
(A) 5
(B) 6
(C) 7
(D) 8
Choose the correct answer from the options given below:
(a) (A), (B) and (C) Only
(b) (B), (C) and (D) Only
(c) (A), (C) and (D) Only
(d) (A), (B), (C) and (D)
Ans: B
Sol: The correct answer is (B), (C) and (D) Only
To determine the valid bases y for the number (45)y , we need to ensure that all digits in the number are valid in that base. The digits in the number 45 are 4 and 5.
Valid Base Criteria:
Evaluating the Options:
Conclusion:
The valid bases are y = 6, 7, and 8 .
Correct Answer: 2) (B), (C) and (D) Only
Q73: Fifth normal form is concerned with :
(a) Join Dependency
(b) Domain-Key
(c) Multivalued dependency
(d) Functional dependency
Ans: A
Sol: The correct answer is Join Dependency
Other Related Points
Q74: Match List I with List - II.
Choose the correct answer from the options given below:
(a) (A) - (III), (B) - (IV), (C) - (I), (D) - (II)
(b) (A) - (III), (B) - (I), (C) - (IV), (D) - (II)
(c) (A) - (I), (B) - (III), (C) - (IV), (D) - (II)
(d) (A) - (I), (B) - (IV), (C) - (III), (D) - (II)
Ans: B
Sol: The correct answer is A - III, B - I, C - IV, D - II
A. Paging - III:
B. LRU (Least Recently Used) - I:
C. C-SCAN - IV:
D. Virtual Memory - II:
Therefore, the correct option is A - III, B - I, C - IV, D - II. So, the correct option is 2).
Q75: A class B network on the Internet has a subnet mask of 255.255.248.0, what is the maximum number of hosts per subnet?
(a) 1022
(b) 1023
(c) 2046
(d) 2047
Ans: C
Sol: The correct answer is 2046
To determine the maximum number of hosts per subnet for a Class B network with the given subnet mask of 255.255.248.0, we need to follow these steps:
Step 1: Understand the Subnet Mask
1. Subnet Mask: 255.255.248.0
2. Subnet Mask in CIDR Notation:
Step 2: Calculate the Number of Host Bits
1. Total Bits: In an IPv4 address, there are 32 bits.
2. Network Bits: 21 bits are used for the network.
3.
Step 3: Calculate the Maximum Number of Hosts
1. The formula for calculating the maximum number of hosts in a subnet is:
The subtraction of 2 accounts for the network address and the broadcast address, which cannot be assigned to hosts.
2. Substitute the number of host bits:
Conclusion: The maximum number of hosts per subnet for a Class B network with a subnet mask of 255.255.248.0 is 2046.
Correct Answer: 3) 2046
Q76: Arrange the following Language Classes in ascending order according to their expressive power, as defined by Chomsky hierarchy :
(A) Context-free languages
(B) Context-sensitive languages
(C) Regular languages
(D) Unrestricted Grammars.
Choose the correct answer from the options given below:
(a) (C), (A), (B), (D)
(b) (C), (A), (D), (B)
(c) (A), (C), (B), (D)
(d) (A), (D), (B), (C)
Ans: A
Sol: The correct answer is (C), (A), (B), (D).
Thus the correct answer is (C), (A), (B), (D).
Other Related Points
Q77: A multi processor system with 16 processors is used to execute a parallelizable task. If the serial portion of the task takes 200 clock cycles and the parallel portion take 800 clock cycles. When all 16 processor are used how many total clock cycles are required to complete the task?
(a) 250
(b) 300
(c) 400
(d) 450
Ans: A
Sol: The correct answer is 250
Calculation:
To calculate the total clock cycles required to complete the task in a multi-processor system with 16 processors, we can follow these steps:
Conclusion:
The total clock cycles required to complete the task is 250.
Correct Answer: 1) 250.
Q78: If L1 and L2 are context free languages, which of the following is True about L1 ∩ L2 ?
(a) L1 ∩ L2 is context free
(b) L1 ∩ L2 is Regular
(c) L1 ∩ L2 is Recursively Enumerable
(d) L1 ∩ L2 is Context Sensitive
Ans: C
Sol: The correct answer is L1 ∩ L2 is Recursively Enumerable
Concept:
To determine the properties of the intersection of two context free languages L1 and L2 , we need to analyze each option provided.
Context-Free Languages
1. L1 and L2 are Context-Free Languages (CFLs):
Context-free languages are closed under union and concatenation but not closed under intersection.
1. L1 ∩ L2 is context-free:
False. The intersection of two context-free languages is not guaranteed to be context free. For example, if , which is not context-free in this context.
2. L1 ∩ L2 is regular:
False. The intersection of two context-free languages is not necessarily regular. Regular languages are a subset of context free languages, but the intersection of two CFLs can produce a language that is not regular.
3. L1 ∩ L2 is recursively enumerable:
True. Context-free languages are a subset of recursively enumerable languages. Since both L1 and L2 are context-free, their intersection L1 ∩ L2 is recursively enumerable.
4. L1 ∩ L2 is context-sensitive:
True, but it is a broader statement. All context-free languages are context-sensitive, and since the intersection can produce a language that fits within the context-sensitive category, this statement is also valid, but it doesn't specifically apply only to CFLs.
Conclusion: The correct answer is: 3) L1 ∩ L2 is Recursively Enumerable
Q79: Consider the following relations on {1, 2, 3, 4). Which of the following relations are reflexive?
(A) R1 = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 4), (4, 1), (4, 4))
(B) R2 = {(1, 1), (1, 2), (2, 1))
(C) R3 = {(1, 1), (1, 2), (1, 4), (2, 1), (2, 2), (3, 3), (4, 1), (4, 4))
(D) R4 = {(2, 1), (3, 1), (3, 2), (4, 1), (4, 2), (4, 3)}
(E) R5 = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (2, 3), (2, 4), (3, 3), (3, 4), (4, 4)}
Choose the correct answer from the options given below:
(a) (A), (B) and (C) Only
(b) (A), (D) and (E) Only
(c) (D) and (E) Only
(d) (C) and (E) Only
Ans: D
Sol: The correct answer is (C) and (E) Only
Concept:
To determine which relations are reflexive, we need to check if every element in the set {1, 2, 3, 4} is related to itself. In other words, for a relation to be reflexive, it must contain all pairs (x, x) for each element x in the set.
Given Relations:
1. R1 = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 4), (4, 1), (4, 4)}
Missing: (3, 3) Not reflexive.
2. R2 = {(1, 1), (1, 2), (2, 1)}
Missing: (2, 2), (3, 3), (4, 4) Not reflexive.
3. R3 = {(1, 1), (1, 2), (1, 4), (2, 1), (2, 2), (3, 3), (4, 1), (4, 4)}
Contains: (1, 1), (2, 2), (3, 3), (4, 4) Reflexive.
4. R4 = {(2, 1), (3, 1), (3, 2), (4, 1), (4, 2), (4, 3)}
Missing: (1, 1), (2, 2), (3, 3), (4, 4) Not reflexive.
5. R5 = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (2, 3), (2, 4), (3, 3), (3, 4), (4, 4)}
Contains: (1, 1), (2, 2), (3, 3), (4, 4) Reflexive.
Summary:
Conclusion:
Q80: Arrange the following phases of database design in the correct order:
(A) Physical Design
(B) Conceptual Design
(C) Logical Design
(D) Requirement Analysis
Choose the correct answer from the options given below:
(a) (B), (D), (A), (C)
(b) (C), (A), (B), (D)
(c) (D), (B), (C), (A)
(d) (A), (D), (C), (B)
Ans: C
Sol: The correct answer is (D), (B), (C), (A).
Thus, the correct order of the phases in database design is (D), (B), (C), (A).
Additional Information
Q81: If a software project has 2000 lines of code (LOC) and the average productivity rate is 10 LOC per person-hour, how many person-hours are required to complete the project?
(a) 100
(b) 150
(c) 200
(d) 250
Ans: C
Sol: Solution:
To calculate the required person-hours, you can use the following formula:
Given:
Substitute the values:
Thus, the correct answer is: 3) 200.
Q82: Two computers A and B are configured as follows: A has IP address 203.197.2.53 and subnet mask 255.255.128.0, B has IP address 203.197.75.201 and subnet mask 255.255.192.0. What one of the following statement is true?
(a) A and B both assume they are on the same network
(b) B assumes, A is on same network, A assumes B is on different network
(c) A assumes, B is on same network, but B assumes, A is on a different network
(d) A and B both assume they are on different network
Ans: C
Sol: The correct answer is A assumes, B is on same network, but B assumes, A is on a different network
Given Information:
Computer A:
Computer B:
Step 1: Calculate the Network Address for A
1. Convert the Subnet Mask to Binary:
2. Convert the IP Address to Binary:
3. Perform Bitwise AND:
Step 2: Calculate the Network Address for B
1. Convert the Subnet Mask to Binary:
2. Convert the IP Address to Binary:
3. Perform Bitwise AND:
Summary of Network Addresses:
Step 3: Determine Network Assumptions
For Computer A (203.197.2.53):
For Computer B (203.197.75.201):
Conclusion
Thus, the correct option is indeed: 3) A assumes B is on the same network, but B assumes A is on a different network.
Q83: A vector processor with 16 lanes can perform an operation on 1024 elements with each operation taking 5 clock cycles. How many cycles are needed to complete the operation?
(a) 64
(b) 80
(c) 100
(d) 128
Ans: A
Sol: The correct answer is 64
1. Vector processors can perform operations on multiple data elements simultaneously. In this case, the processor has 16 lanes, meaning it can operate on 16 elements in parallel in each clock cycle.
2. You need to process a total of 1024 elements.
3. The number of cycles required to process these 1024 elements is determined by how many sets of 16 elements can be processed in sequence. So:
4. Each set of operations (on 16 elements) takes 5 clock cycles.
5. But since the processor can operate on 16 elements in parallel, all 16 elements are processed simultaneously within those 5 cycles, regardless of how many total operations are performed. Hence, 5 clock cycles are needed per set of elements, and only one set of 5 cycles is required for each of the 64 groups of elements.
Therefore, the total clock cycles needed to complete the operation across all elements is:
So the correct answer is 64, as only 64 sets of operations (each taking 5 cycles) are necessary to cover all the 1024 elements.
Q84: Arrange the following steps in a proper sequence for the process of training a neural network.
(A) Weight initialization
(B) Feed forward
(C) Back Propagation
(D) Loss Calculation
(E) Weight Update
Choose the correct answer from the options given below:
(a) (A), (B), (D), (C), (E)
(b) (D), (B), (A), (C), (E)
(c) (A), (C), (D), (B), (E)
(d) (E), (C), (B), (D), (A)
Ans: A
Sol: The correct answer is (A), (B), (D), (C), (E).
Thus the correct answer is (A), (B), (D), (C), (E).
Other Related Points
Q85: 40 software professionals were interviewed for a job. 25 knew PYTHON 20 knew JAVA and 7 knew neither language. How many knew both languages?
(a) 12
(b) 53
(c) 10
(d) 88
Ans: A
Sol: Solution:
Let’s break down the problem step by step:
So, the number of professionals who knew either PYTHON or JAVA or both is: 40 - 7 = 33
Now, let’s use the formula for the union of two sets:
Substitute the known values:
Q86: Which of the following are TRUE about constructors in C++?
(A) A constructor can be overloaded.
(B) A constructor does not have a return type.
(C) A constructor must be declared as a friend function.
(D) A constructor is called when an object is destroyed.
Choose the correct answer from the options given below:
(a) (B), (C), (D) Only
(b) (B), (C) Only
(c) (A), (B), (C) Only
(d) (A), (B) Only
Ans: D
Sol: The correct answer is 4)(A), (B) Only
(A) A constructor can be overloaded. -
(B) A constructor does not have a return type. -
(C) A constructor must be declared as a friend function. -
(D) A constructor is called when an object is destroyed. -
Q87: A graph G with number of vertices greater and equal than three i.e. (n ≥ 3) is a Hamiltonian graph, if the degree of each vertex is greater and equal to...
(a) Equal to number of vertices
(b) Double of number of vertices
(c) Half of number of vertices
(d) Four times of number of vertices
Ans: C
Sol: The correct answer is Half of number of vertices
Correct Condition:
Thus, the correct answer is: 3) Half of number of vertices
Q88: Match List - I with List - II.
Choose the correct answer from the options given below:
(a) (A) - (I), (B) - (III), (C) - (II), (D) - (IV)
(b) (A) - (II), (B) - (III), (C) - (IV), (D) - (I)
(c) (A) - (II), (B) - (I), (C) - (IV), (D) - (III)
(d) (A) - (III), (B) - (I), (C) - (IV), (D) - (II)
Ans: C
Sol: The correct answer is (A) - (II), (B) - (I), (C) - (IV), (D) - (III)
HTML:
DHTML:
XML:
JAVA:
Therefore, the correct option is (A) - (II), (B) - (I), (C) - (IV), (D) - (III). So, the correct option is 3).
Q89: What will be the output of the following C code?
#include <stdio. h>
void main()
{
int arr[5] = {10, 20, 30, 40, 50};
int *p = (int*) (&arr + 1);
printf("%d %d", *(arr + 1), *(p - 1));
}
(a) 10 50
(b) 20 50
(c) 30 40
(d) 20 40
Ans: B
Sol: The correct answer is 20 50
Concept:
In C, the array `arr` is a contiguous block of memory. When we use the expression `&arr + 1`, it points to the address just past the end of the array. By casting this to an integer pointer and subtracting one, we get the address of the last element of the array.
Consider the given C code:
#include < stdio. h > void main() { int arr[5] = {10, 20, 30, 40, 50}; int *p = (int*) (&arr + 1); printf("%d %d", *(arr + 1), *(p - 1)); }
1. `int arr[5] = {10, 20, 30, 40, 50};` initializes an array of 5 integers.
2. `int *p = (int*) (&arr + 1);` - `&arr` gives the address of the entire array `arr`. - `&arr + 1` points to the memory address just past the end of the array. - Casting this to `(int*)` and then subtracting one gets us the address of the last element in the array.
3. `printf("%d %d", *(arr + 1), *(p - 1));` - `*(arr + 1)` fetches the value at the index `1` of the array, which is `20`. - `*(p - 1)` fetches the value just before the address `p`, which is the last element of the array, `50`.
So, the output of the program will be `20 50`.
Hence the correct answer is Option 2: 20 50.
Q90: Consider the following C code: .
#include <stdio.h>
int temp = 0;
int fun(int x, int y) {
int z;
temp++;
if (y == 3) return(x * x * x);
else {
z = fun(x, y / 3);
return(z * z * z);
}
}
int main() {
fun(4, 81);
printf("%d", temp);
return 0;
}
What will be the output of the above code ?
(a) 3
(b) 4
(c) 5
(d) 6
Ans: B
Sol: The correct answer is 4
Concept:
This problem involves understanding recursion in C and how global variables are affected by recursive function calls. The function `fun` is a recursive function that increments a global variable `temp` each time it is called. The recursion continues until `y` is no longer divisible by 3, at which point the function returns a value and the recursion unwinds.
Let's break down the code step by step:
#include int temp = 0; int fun(int x, int y) { int z; temp++; if (y == 3) return(x * x * x); else { z = fun(x, y / 3); return(z * z * z); } } int main() { fun(4, 81); printf("%d", temp); return 0; }
1. `fun(4, 81)` is called.
2. `temp` is incremented to 1. Since `y` (81) is not 3, the function calls `fun(4, 81 / 3)` i.e., `fun(4, 27)`.
3. `temp` is incremented to 2. Since `y` (27) is not 3, the function calls `fun(4, 27 / 3)` i.e., `fun(4, 9)`.
4. `temp` is incremented to 3. Since `y` (9) is not 3, the function calls `fun(4, 9 / 3)` i.e., `fun(4, 3)`.
5. `temp` is incremented to 4. Now, since `y` (3) is equal to 3, the function returns `4 * 4 * 4` which is 64.
6. This return value (64) is then cubed at each level of recursion as it unwinds, but these return values do not affect the global `temp` variable.
The total number of times `fun` is called before reaching the base case is 4. Therefore, the value of `temp` is 4.
Hence the correct answer is 2) 4.
Q91: Read the below passage and answer the questions.
Artificial Neural Networks (ANNs) are computational models inspired by the human brain's neural networks. They consist of interconnected nodes, or neurons, organized into layers: an input layer, one or more hidden layers and an output layer. Each connection between neurons has a weight that adjusts as learning progresses allowing the network to adopt and improve its performance. ANNs are particularly effective in recognizing patterns making them valuable for tasks such as image and speech recognition, Natural language processing and predictive analytics. Learning in ANNs typically involves training algorithms like back propagation, which minimize the error by adjusting the weights. As a subset of machine learning, ANNs have revolutionized the field of Artificial Intelligence by providing solutions to complex problems that traditional algorithms struggle with.
Artificial Neural Networks (ANNs) are inspired by:
(a) Quantum mechanics
(b) Human brain's neural network
(c) Computer Hardware architecture
(d) Genetic algorithm
Ans: B
Sol: The correct answer is Human brain's neural network.
Other Related Points
Q92: Read the below passage and answer the questions.
Artificial Neural Networks (ANNs) are computational models inspired by the human brain's neural networks. They consist of interconnected nodes, or neurons, organized into layers: an input layer, one or more hidden layers and an output layer. Each connection between neurons has a weight that adjusts as learning progresses allowing the network to adopt and improve its performance. ANNs are particularly effective in recognizing patterns making them valuable for tasks such as image and speech recognition, Natural language processing and predictive analytics. Learning in ANNs typically involves training algorithms like back propagation, which minimize the error by adjusting the weights. As a subset of machine learning, ANNs have revolutionized the field of Artificial Intelligence by providing solutions to complex problems that traditional algorithms struggle with.
What is the role of Back Propagation Algorithm?
(a) To reduce error
(b) To secure network
(c) To control speed of data
(d) To add different layers
Ans: A
Sol: The correct answer is To reduce error.
Other Related Points
Q93: Read the below passage and answer the questions.
Artificial Neural Networks (ANNs) are computational models inspired by the human brain's neural networks. They consist of interconnected nodes, or neurons, organized into layers: an input layer, one or more hidden layers and an output layer. Each connection between neurons has a weight that adjusts as learning progresses allowing the network to adopt and improve its performance. ANNs are particularly effective in recognizing patterns making them valuable for tasks such as image and speech recognition, Natural language processing and predictive analytics. Learning in ANNs typically involves training algorithms like back propagation, which minimize the error by adjusting the weights. As a subset of machine learning, ANNs have revolutionized the field of Artificial Intelligence by providing solutions to complex problems that traditional algorithms struggle with.
Which of the following layers may be more than one in number?
(a) Input layer
(b) Hidden layer
(c) Output layer
(d) Physical layer
Ans: B
Sol: The correct answer is Hidden layer.
Other Related Points
Q94: Read the below passage and answer the questions.
Artificial Neural Networks (ANNs) are computational models inspired by the human brain's neural networks. They consist of interconnected nodes, or neurons, organized into layers: an input layer, one or more hidden layers and an output layer. Each connection between neurons has a weight that adjusts as learning progresses allowing the network to adopt and improve its performance. ANNs are particularly effective in recognizing patterns making them valuable for tasks such as image and speech recognition, Natural language processing and predictive analytics. Learning in ANNs typically involves training algorithms like back propagation, which minimize the error by adjusting the weights. As a subset of machine learning, ANNs have revolutionized the field of Artificial Intelligence by providing solutions to complex problems that traditional algorithms struggle with.
What is the role of weights in an ANN?
(a) To store data
(b) To adjust and improve network performance
(c) To control the speed
(d) To secure the network
Ans: B
Sol: The correct answer is To adjust and improve network performance.
Other Related Points
Q95: Read the below passage and answer the questions.
Artificial Neural Networks (ANNs) are computational models inspired by the human brain's neural networks. They consist of interconnected nodes, or neurons, organized into layers: an input layer, one or more hidden layers and an output layer. Each connection between neurons has a weight that adjusts as learning progresses allowing the network to adopt and improve its performance. ANNs are particularly effective in recognizing patterns making them valuable for tasks such as image and speech recognition, Natural language processing and predictive analytics. Learning in ANNs typically involves training algorithms like back propagation, which minimize the error by adjusting the weights. As a subset of machine learning, ANNs have revolutionized the field of Artificial Intelligence by providing solutions to complex problems that traditional algorithms struggle with.
Which of the following is/are the application area(s) of ANN?
(A) Natural Language Processing
(B) Image Processing
(C) Pattern Recognition
(D) Speech Recognition
Choose the correct answer from the options given below:
(a) (A) and (B) Only
(b) (B) and (C) Only
(c) (A), (B) and (C) Only
(d) (A), (B), (C) and (D)
Ans: D
Sol: The correct answer is (A), (B), (C) and (D).
Artificial Neural Networks (ANNs) are particularly effective in recognizing patterns, making them valuable for tasks such as image and speech recognition, natural language processing, and predictive analytics.
All of the above areas are applications of Artificial Neural Networks (ANNs). Here's why:
(A) Natural Language Processing (NLP): ANNs are widely used in NLP tasks such as machine translation, sentiment analysis, and text generation.
(B) Image Processing: ANNs, particularly convolutional neural networks (CNNs), are heavily used in image classification, object detection, and image recognition tasks.
(C) Pattern Recognition: ANNs are designed to recognize patterns in data and are used in applications like handwriting recognition and biometric identification.
(D) Speech Recognition: ANNs, especially recurrent neural networks (RNNs) and long short-term memory (LSTM) networks, are used in speech-to-text systems and voice recognition applications.
Therefore, all of the options (A, B, C, and D) are correct applications of ANNs.
Q96: Read the below passage and answer the questions.
The Banker's Algorithm is a critical deadlock avoidance method in operating systems, designed to facilitate resource allocation without causing deadlock. It operates by maintaining information about the maximum resources. Each process may require, the current allocated resources and the available resources in the system. The algorithm checks each resource request to determine, if granting it would leave the system in a safe state, meaning that there is always a sequence in which all processes can complete their execution without getting stuck due to resource unavailability. Each process must specify its maximum demand for each resource type before it starts execution. When a process requests additional resources, the algorithm checks if granting the request will keep the system in a safe state. If so, the resources are allocated otherwise the process must wait until its request can be safely fulfilled.
What is the significance of the Banker's algorithm in terms of resource management ?
(a) It enures that all processes can finish their execution without deadlock.
(b) It eliminates the need for processes to request resources.
(c) It accelerates the execution of critical sections in processes.
(d) It minimizes the number of context switches between processes.
Ans: A
Sol: The correct answer is It ensures that all processes can finish their execution without deadlock.
Other Related Points
Q97: Read the below passage and answer the questions.
The Banker's Algorithm is a critical deadlock avoidance method in operating systems, designed to facilitate resource allocation without causing deadlock. It operates by maintaining information about the maximum resources. Each process may require, the current allocated resources and the available resources in the system. The algorithm checks each resource request to determine, if granting it would leave the system in a safe state, meaning that there is always a sequence in which all processes can complete their execution without getting stuck due to resource unavailability. Each process must specify its maximum demand for each resource type before it starts execution. When a process requests additional resources, the algorithm checks if granting the request will keep the system in a safe state. If so, the resources are allocated otherwise the process must wait until its request can be safely fulfilled.
What is the primary goal of the Banker's Algorithm?
(a) To allocate resources optimally
(b) To prevent processes from requesting resources
(c) To detect and recover from deadlocks
(d) To maximise CPU utilization
Ans: A
Sol: The correct answer is To allocate resources optimally
The primary goal of the Banker's Algorithm is to avoid deadlock by ensuring that resources are allocated in such a way that the system remains in a safe state, meaning that all processes can complete their execution without getting stuck due to resource unavailability. It checks whether granting a resource request will leave the system in a safe state before allocating resources.
Therefore, the focus is on optimal and safe resource allocation to prevent deadlock, not on detecting or recovering from deadlocks, preventing requests, or maximizing CPU utilization.
Q98: Read the below passage and answer the questions.
The Banker's Algorithm is a critical deadlock avoidance method in operating systems, designed to facilitate resource allocation without causing deadlock. It operates by maintaining information about the maximum resources. Each process may require, the current allocated resources and the available resources in the system. The algorithm checks each resource request to determine, if granting it would leave the system in a safe state, meaning that there is always a sequence in which all processes can complete their execution without getting stuck due to resource unavailability. Each process must specify its maximum demand for each resource type before it starts execution. When a process requests additional resources, the algorithm checks if granting the request will keep the system in a safe state. If so, the resources are allocated otherwise the process must wait until its request can be safely fulfilled.
What information is used to determine if a resource request can be granted ?
(a) Available resources and current allocation of each process
(b) CPU utilization of each process
(c) Number of processes waiting for resources
(d) Arrival time of each process
Ans: A
Sol: The correct answer is Available resources and current allocation of each process.
Other Related Points
Q99: Read the below passage and answer the questions.
The Banker's Algorithm is a critical deadlock avoidance method in operating systems, designed to facilitate resource allocation without causing deadlock. It operates by maintaining information about the maximum resources. Each process may require, the current allocated resources and the available resources in the system. The algorithm checks each resource request to determine, if granting it would leave the system in a safe state, meaning that there is always a sequence in which all processes can complete their execution without getting stuck due to resource unavailability. Each process must specify its maximum demand for each resource type before it starts execution. When a process requests additional resources, the algorithm checks if granting the request will keep the system in a safe state. If so, the resources are allocated otherwise the process must wait until its request can be safely fulfilled.
Which data structure does the Banker's Algorithm use to maintain the state of available, maximum and allocated resources ?
(a) Priority Queue
(b) Hash table
(c) Wait-for-Graph
(d) Matrices and Vectors
Ans: D
Sol: The correct answer is Matrices and Vectors.
Other Related Points
Q100: Read the below passage and answer the questions.
The Banker's Algorithm is a critical deadlock avoidance method in operating systems, designed to facilitate resource allocation without causing deadlock. It operates by maintaining information about the maximum resources. Each process may require, the current allocated resources and the available resources in the system. The algorithm checks each resource request to determine, if granting it would leave the system in a safe state, meaning that there is always a sequence in which all processes can complete their execution without getting stuck due to resource unavailability. Each process must specify its maximum demand for each resource type before it starts execution. When a process requests additional resources, the algorithm checks if granting the request will keep the system in a safe state. If so, the resources are allocated otherwise the process must wait until its request can be safely fulfilled.
Which of the following is NOT a requirement for Banker's algorithm to grant a resource request?
(a) The requested resources must be available.
(b) The system must be in a safe state after granting the request.
(c) The request must not exceed the maximum resources the process can request.
(d) The process must be the only one requesting resources.
Ans: D
Sol: The correct answer is The process must be the only one requesting resources..
Other Related Points
1. What is the UGC NET Paper 2 in Computer Science about? | ![]() |
2. How is the UGC NET Computer Science exam structured? | ![]() |
3. What are the eligibility criteria for appearing in the UGC NET Computer Science exam? | ![]() |
4. What resources are recommended for preparing for the UGC NET Computer Science exam? | ![]() |
5. How can candidates effectively manage their time during the UGC NET Computer Science exam? | ![]() |