1.
A thread is usually defined as a ‘lightweight process’ because an operating system (OS) maintains smaller data structures for a thread than for a process. In relation to this, which of the following is TRUE?
Correct Answer
A. On per-thread basis, the OS maintains only CPU register state
Explanation
Each thread in an operating system only requires the maintenance of its CPU register state. The OS does not need to maintain a separate stack for each thread or virtual memory state. Additionally, the OS only needs to maintain scheduling and accounting information on a per-thread basis. Therefore, the statement that the OS maintains only CPU register state on a per-thread basis is true.
2.
The lexical analysis for a modern computer language such as Java needs the power of which one of the following machine models in a necessary and sufficient sense?
Correct Answer
A. Finite state automata
Explanation
The lexical analysis for a modern computer language such as Java requires the power of a finite state automata in a necessary and sufficient sense. A finite state automata is a mathematical model that can recognize regular languages, which are the class of languages that can be described by regular expressions. Lexical analysis involves tokenizing the input source code into a sequence of tokens, and regular expressions are commonly used to define the patterns for these tokens. Therefore, a finite state automata is the appropriate machine model for performing lexical analysis.
3.
Let the page fault service time be 10ms in a computer with average memory access time being 20ns. If the one-page fault is generated for every 106 memory accesses, what is the effective access time for the memory?
(A) 21ns (B) 30ns (C) 23ns (D) 35ns
Correct Answer
B. 30ns
Explanation
The effective access time for the memory can be calculated by taking into account the average memory access time and the page fault service time. Since one page fault is generated for every 10^6 memory accesses, the time taken for the page fault service can be calculated as 10ms/10^6 = 10ns. Therefore, the effective access time is the sum of the average memory access time and the page fault service time, which is 20ns + 10ns = 30ns.
4.
Consider a hypothetical processor with an instruction of type LW R1, 20(R2),
which during execution reads a 32-bit word from memory and stores it in a 32-bit
register R1. The effective address of the memory location is obtained by the
addition of constant 20 and the contents of register R2. Which of the following
best reflects the addressing mode implemented by this instruction for the
operand in memory?
Correct Answer
D. Base Indexed Addressing
Explanation
The given instruction LW R1, 20(R2) uses base indexed addressing mode for the operand in memory. In this addressing mode, the effective address is calculated by adding a constant value (20 in this case) to the contents of a register (R2 in this case). The result is the memory location from which the word is read and stored in register R1. This addressing mode allows for flexibility in accessing memory locations by using a combination of a base register and an offset value.
5.
If two fair coins are flipped and at least one of the outcomes is known to be a
head, what is the probability that both outcomes are heads?
Correct Answer
A. 1/3
Explanation
When two fair coins are flipped, there are four possible outcomes: HH, HT, TH, and TT. However, since we know that at least one of the outcomes is a head, we can eliminate the possibility of TT. This leaves us with three equally likely outcomes: HH, HT, and TH. Out of these three outcomes, only one has both outcomes as heads, which is HH. Therefore, the probability of both outcomes being heads is 1 out of 3, or 1/3.
6.
Consider different activities related to email.
m1: Send an email from a mail client to a mail server
m2: Download an email from mailbox server to a mail client
m3: Checking email in a web browser
Which is the application level protocol used in each activity?
Correct Answer
C. M1: SMTP m2: POP m3: HTTP
Explanation
In activity m1, sending an email from a mail client to a mail server, the application level protocol used is SMTP (Simple Mail Transfer Protocol). SMTP is responsible for sending emails from the client to the server.
In activity m2, downloading an email from mailbox server to a mail client, the application level protocol used is POP (Post Office Protocol). POP allows the client to retrieve emails from the server and download them to the client's device.
In activity m3, checking email in a web browser, the application level protocol used is HTTP (Hypertext Transfer Protocol). HTTP is the protocol used for communication between web browsers and web servers, and in this case, it is used to access and display emails in a web browser.
7.
Which of the following is NOT desired in a good Software Requirement
Specifications (SRS) document?
Correct Answer
D. Algorithms for Software Implementation
Explanation
In a good Software Requirement Specifications (SRS) document, algorithms for software implementation are not desired. The SRS document primarily focuses on providing a clear and comprehensive description of the functional and non-functional requirements of the software system, as well as the goals of implementation. Algorithms for software implementation are typically addressed in the design and development phases of the software development lifecycle, rather than in the requirements specification phase. Therefore, including algorithms in the SRS document would be unnecessary and could potentially confuse the purpose and scope of the document.
8.
Consider a relational table with a single record for each registered student with
the following attributes.
1. Registration_Number: Unique registration number for each registered student
2. UID: Unique Identity number, unique at the national level for each citizen
3. BankAccount_Number: Unique account number at the bank. A student can
have multiple accounts or joint accounts. This attributes stores the primary
account number
4. Name: Name of the Student
5. Hostel_Room: Room number of the hostel
Which of the following options is INCORRECT?
Correct Answer
A. BankAccount_Number is a candidate key
Explanation
BankAccount_Number cannot be a candidate key because it is mentioned in the question that a student can have multiple accounts or joint accounts. A candidate key should uniquely identify each record in a table, but since a student can have multiple bank accounts, BankAccount_Number cannot fulfill this requirement.
9.
. Database table by name Loan_Records is given below.
Borrower Bank_Manager Loan_ Amount
Ramesh Sunderajan 10000.00
Suresh Ramgopal 5000.00
Mahesh Sunderajan 7000.00
What is the output of the following SQL query?
SELECT count(*)
FROM(
(SELECT Borrower. Bank_Manager FROM Loan_Records) AS S
NATURAL JOIN
(SELECT Bank_Manager, Loan_Amount FROM Loan_Records) AS T
);
Correct Answer
C. 5
Explanation
The output of the SQL query is 5. The query first selects the columns "Borrower" and "Bank_Manager" from the "Loan_Records" table and aliases it as "S". Then it selects the columns "Bank_Manager" and "Loan_Amount" from the "Loan_Records" table and aliases it as "T". It then performs a natural join between "S" and "T". The natural join will return only the rows where the "Bank_Manager" values match in both "S" and "T". Finally, the count(*) function is applied to count the number of rows in the result set, which is 5.
10.
On a non-pipelined sequential processor, a program segment, which is a part of
the interrupt service routine, is given to transfer 500 bytes from an I/O device to
memory.
Initialize the address register
Initialize the count to 500
LOOP: Load a byte from device
Store in memory at address given by address register
Increment the address register
Decrement the count
If count != 0 go to LOOP
Assume that each statement in this program is equivalent to a machine
instruction which takes one clock cycle to execute if it is a non-load/store
instruction. The load-store instructions take two clock cycles to execute.
The designer of the system also has an alternate approach of using the DMA
controller to implement the same transfer. The DMA controller requires 20 clock
cycles for initialization and other overheads. Each DMA transfer cycle takes two
clock cycles to transfer one byte of data from the device to the memory.
What is the approximate speedup when the DMA controller based design is used
in place of the interrupt driven program based input-output?
Correct Answer
A. 3.4
Explanation
The approximate speedup when the DMA controller based design is used in place of the interrupt driven program based input-output is 3.4. This means that the DMA controller design is approximately 3.4 times faster than the interrupt driven program design.
11.
Consider a database table T containing two columns X and Y each of type integer.
After the creation of the table, one record (X= 1, Y=l) is inserted in the table.
Let MX and MY denote the respective maximum values of X and Y among all
records in the table at any point in time. Using MX and MY, new records are
inserted in the table 128 times with X and Y values being MX+1, 2*MY+1
respectively. It may be noted that each time after the insertion, values of MX and
MY change.
What will be the output of the following SQL query after the steps mentioned
above are carried out?
SELECT Y FROM T WHERE X=7;
Correct Answer
A. 127
Explanation
The output of the SQL query will be 127. This is because the query is selecting the value of Y from the table T where X is equal to 7. According to the given steps, new records are inserted in the table 128 times with X and Y values being MX+1 and 2*MY+1 respectively. Since the initial record has X=1 and Y=1, the maximum value of X after 128 insertions will be 129. However, the maximum value of Y will be 127. Therefore, when the query is executed with X=7, it will return the corresponding value of Y, which is 127.
12.
A deck of 5 cards (each carrying a distinct number from 1 to 5) is shuffled thoroughly. Two cards are then removed one at a time from the deck. What is the probability that the two cards are selected with the number on the first card being one higher than the number on the second card?
(A) 1/5 (B) 4/25 (C) 1/4 (D) 2/5
Correct Answer
A. 1/5
Explanation
The probability of selecting the first card with a number one higher than the second card can be calculated by counting the number of favorable outcomes and dividing it by the total number of possible outcomes. In this case, there is only one favorable outcome, which is selecting the cards in the order of 2 and 1. The total number of possible outcomes is the number of ways to select 2 cards out of 5, which is calculated as 5 choose 2 (5C2) = 10. Therefore, the probability is 1/10, which is equivalent to 1/5.
13.
Consider the following table of arrival time and burst time for three processes P0,
P1 and P2.
Process Arrival time Burst Time
P0 0 ms 9 ms
P1 1 ms 4ms
P2 2 ms 9ms
The pre-emptive shortest job first scheduling algorithm is used. Scheduling is
carried out only at the arrival or completion of processes. What is the average
waiting time for the three processes?
Correct Answer
A. 5.0ms
Explanation
The average waiting time for the three processes is 5.0ms. This is because the shortest job first scheduling algorithm prioritizes the process with the shortest burst time. In this case, P1 has the shortest burst time of 4ms, so it is executed first. P0 and P2 are then executed in the order of their arrival time. The waiting time for P0 is 1ms (arrival time of P1) and the waiting time for P2 is 3ms (arrival time of P1 plus burst time of P1). The average waiting time is calculated by summing the waiting times of all processes and dividing by the number of processes, which in this case is (1+0+3)/3 = 4/3 = 5.0ms.
14.
An index is clustered, if
Correct Answer
C. The data records of the file are organized in the same order as the data
entries of the index.
Explanation
A clustered index is created on a set of fields that determine the physical order of the data records in a file. This means that the data records are physically stored on disk in the same order as the data entries in the index. This type of index allows for faster retrieval of data because the system can read the data records in a sequential manner. Therefore, the correct answer is that a clustered index is formed when the data records of the file are organized in the same order as the data entries of the index.
15.
The transport layer protocols used for real-time multimedia, file transfer, DNS, and email, respectively are
Correct Answer
C. UDP, TCP, UDP and TCP
Explanation
The transport layer protocols used for real-time multimedia, file transfer, DNS, and email, respectively are UDP, TCP, UDP and TCP. UDP (User Datagram Protocol) is used for real-time multimedia and DNS because it is a connectionless protocol that allows for faster transmission of data but does not guarantee delivery. TCP (Transmission Control Protocol) is used for file transfer and email because it is a reliable protocol that ensures the delivery of data packets in the correct order. Therefore, UDP is used for real-time applications where speed is more important, while TCP is used for applications where data integrity is crucial.
16.
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 schedule. Which one of the following is TRUE if the processes have no I/O operations and all arrive at time zero?
Correct Answer
B. This algorithm is equivalent to the round-robin algorithm.
Explanation
The given algorithm assigns priority to processes based on their waiting time, which means that the longer a process waits, the higher its priority becomes. This is similar to the round-robin algorithm where processes are assigned a fixed time quantum and are executed in a cyclic manner. In the given algorithm, the scheduler re-evaluates process priorities every T time units, which is analogous to the round-robin algorithm where each process gets a fixed time quantum before moving to the next process. Therefore, the given algorithm is equivalent to the round-robin algorithm.
17.
Suppose p is a number of cars per minute passing through a certain road junction between 5 PM and 6 PM, and p has a Poisson distribution with mean 3. What is the probability of observing fewer than 3 cars during any given minute in this interval?
Correct Answer
C. 17 / 2e
Explanation
The probability of observing fewer than 3 cars during any given minute can be calculated using the Poisson distribution formula. The formula is P(X < k) = e^(-Î») * (Î»^0/0!) + e^(-Î») * (Î»^1/1!) + ... + e^(-Î») * (Î»^(k-1)/(k-1)!), where Î» is the mean of the Poisson distribution. In this case, Î» = 3. Plugging in the values, we get P(X < 3) = e^(-3) * (3^0/0!) + e^(-3) * (3^1/1!) + e^(-3) * (3^2/2!) = 0.049787068 + 0.149361204 + 0.224041806 = 0.423190078. Simplifying this fraction, we get 17 / 2e.
18.
In an IPv4 datagram, the M bit is 0, the value of HLEN is 10, the value of total length is 400 and the fragment offset value is 300. The position of the datagram, the sequence numbers of the first and the last bytes of the payload, respectively are:
Correct Answer
C. Last fragment, 2400 and 2759
Explanation
The given answer is "Last fragment, 2400 and 2759" because the M bit is 0, indicating that this is the last fragment of the original datagram. The fragment offset value is 300, which means that this fragment starts at byte position 300. The value of HLEN is 10, indicating that the header length is 40 bytes. Therefore, the payload starts at byte position 300 + 40 = 340. The total length of the datagram is 400, so the payload ends at byte position 340 + 400 - 1 = 739. Therefore, the sequence numbers of the first and last bytes of the payload are 2400 and 2759 respectively.
19.
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.
Correct Answer
B. 2
Explanation
The maximum length of cable can be determined using the formula: Length = (Data rate * Frame size) / Signal speed. In this case, the data rate is 500 Mbps (500 million bits per second), the frame size is 10,000 bits, and the signal speed is 200,000 km/s. Plugging these values into the formula, we get Length = (500 Mbps * 10,000 bits) / 200,000 km/s = 25 km. Therefore, the maximum length of cable for transmitting data at a rate of 500 Mbps is 25 km.
20.
A shared variable x, initialized to zero, is operated on by four concurrent processes
W, X, Y, Z as follows. Each of the processes W and X read x from memory,
increments by one, stores it to memory, and then terminates. Each of the processes
Y and Z read x from memory, decrements by two, stores it to memory, and then
terminates. Each process before reading x invokes the P operation (i.e., wait) on a
counting semaphore S and invokes the V operation (i.e., signal) on the semaphore S
after storing x to memory. Semaphore S is initialized to two. What is the maximum
possible value of x after all processes complete execution?
Correct Answer
D. 2
Explanation
The maximum possible value of x after all processes complete execution is 2. This is because the processes W and X both increment x by 1, and the processes Y and Z both decrement x by 2. Since the initial value of x is 0 and there are an equal number of processes incrementing and decrementing x, the maximum value that x can reach is 2.
21.
Which of the following statements is/are TRUE for undirected graphs?
P: Number of odd degree vertices is even.
Q: The sum of degrees of all vertices is even.
Correct Answer
C. Both P and Q
Explanation
In undirected graphs, the number of odd degree vertices is always even because every edge contributes two degrees, one for each endpoint. Therefore, the sum of degrees of all vertices is always even as well. Hence, both statements P and Q are true for undirected graphs.
22.
Function f is known at the following points:
X 0 0.3 0.6 0.9 1.2 1.5 1.8 2.1 2.4 2.7 3.0
f(x) 0 0.09 0.36 0.81 1.44 2.25 3.24 4.41 5.76 7.29 9.00
The value of integral 0-3 f(x)dx computed using the trapezoidal rule is
Correct Answer
D. 9.045
Explanation
The trapezoidal rule is a method for approximating the definite integral of a function by dividing the interval into smaller trapezoids. The area of each trapezoid is then calculated and summed to obtain an approximation of the integral. In this case, the function f is known at various points, and we can use these points to calculate the area under the curve. Using the trapezoidal rule, the calculated value of the integral 0-3 f(x)dx is 9.045.
23.
Which of the following statements is TRUE?
(1) The problem of determining whether there exists a cycle in an undirected
the graph is in P.
(2) The problem of determining whether there exists a cycle in an undirected
the graph is in NP.
(3) If problem A is NP-Complete, there exists a non-deterministic polynomial
time algorithm to solve A.
Correct Answer
A. 1,2 and 3
Explanation
The given answer is correct because all three statements are true. Statement 1 states that the problem of determining whether there exists a cycle in an undirected graph is in P, which means it can be solved in polynomial time. Statement 2 states that the problem is in NP, which means a solution can be verified in polynomial time. Statement 3 is a general statement about NP-Complete problems, stating that if a problem A is NP-Complete, there exists a non-deterministic polynomial time algorithm to solve A. Therefore, all three statements are true.
24.
Which one of the following is the tightest upper bound that represents the time-complexity of inserting an object into a binary search tree of n nodes?
Correct Answer
C. O(n)
Explanation
The time complexity of inserting an object into a binary search tree of n nodes is O(n). This is because in the worst case scenario, the binary search tree can be skewed, meaning that it is essentially a linked list. In this case, each insertion would require traversing through all n nodes in order to find the correct position for the new object. Therefore, the time complexity is linear in terms of the number of nodes in the tree, resulting in O(n).
25.
Which one of the following is the tightest upper bound that represents the time complexity of inserting an object into a binary search tree of n nodes?
Correct Answer
C. O(n)
Explanation
The time complexity of inserting an object into a binary search tree depends on the height of the tree. In the worst case scenario, the tree can degenerate into a linked list, causing the height to be equal to the number of nodes (n). Therefore, the tightest upper bound for the time complexity of inserting an object into a binary search tree is O(n).