Question 1 of 65
In a compiler, keywords of a language are recognized during
Mock test · GATE marking
You have submitted this test.See your result
This browser is not letting the page save anything. The test will work, but a refresh would lose your answers, and the result cannot be shown after you submit.
The clock starts when you press Start and does not stop. An answer counts only after Save & Next or Mark for Review & Next.
In a compiler, keywords of a language are recognized during
A layer-4 firewall (a device that can look at all protocol headers up to the transport layer) CANNOT
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?
Consider different activities related to email.
: Send an email from a mail client to a mail server
: Download an email from mailbox server to a mail client
: Checking email in a web browser
Which is the application level protocol used in each activity?
A company needs to develop a strategy for software product development for which it has a choice of two programming languages L1 and L2. The number of lines of code (LOC) developed using L2 is estimated to be twice the LOC developed with L1. The product will have to be maintained for five years. Various parameters for the company are given in the table below.
| Parameter | Language L1 | Language L2 |
|---|---|---|
| Man years needed for development | LOC / 10000 | LOC / 10000 |
| Development Cost per man year | Rs 10,00,000 | Rs 7,50,000 |
| Maintenance time | 5 years | 5 years |
| Cost of maintenance per year | Rs 1,00,000 | Rs 50,000 |
Total cost of the project includes cost of development and maintenance. What is the LOC for L1 for which the cost of the project using L1 is equal to the cost of the project using L2?
Let the time taken to switch between user and kernel modes of execution be while the time taken to switch between two processes be . Which of the following is TRUE?
A company needs to develop digital signal processing software for one of its newest inventions. The software is expected to have 40000 lines of code. The company needs to determine the effort in person-months needed to develop this software using the basic COCOMO model. The multiplicative factor for this model is given as 2.8 for the software development on embedded systems, while the exponentiation factor is given as 1.20. What is the estimated effort in person-months?
Which of the following pairs have DIFFERENT expressive power?
HTML (HyperText Markup Language) has language elements which permit certain actions other than describing the structure of the web document. Which one of the following actions is NOT supported by pure HTML (without any server or client side scripting) pages?
Which one of the following is NOT desired in a good Software Requirement Specifications (SRS) document?
A computer handles several interrupt sources of which the following are relevant for this question.
Which one of these will be handled at the HIGHEST priority?
Consider a relational table with a single record for each registered student with the following attributes.
Which of the following options is INCORRECT?
Which one of the following circuits is NOT equivalent to a 2-input XNOR (exclusive NOR) gate?
The simplified SOP (Sum of Product) form of the Boolean expression is
The minimum number of D flip-flops needed to design a mod-258 counter is
A thread is usually defined as a "light weight 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?
If the difference between the expectation of the square of a random variable () and the square of the expectation of the random variable () is denoted by , then
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?
Let the page fault service time be 10 ms in a computer with average memory access time being 20 ns. If one page fault is generated for every memory accesses, what is the effective access time for the memory?
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 a 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?
What does the following fragment of C program print?
char c[] = "GATE2011";
char *p = c;
printf("%s", p + p[3] - p[1]);A max-heap is a heap where the value of each parent is greater than or equal to the value of its children. Which of the following is a max-heap?
Let be a regular language and be a context-free language such that . (For example, let be the language represented by the regular expression and be ). Then which of the following is ALWAYS regular?
An algorithm to find the length of the longest monotonically increasing sequence of numbers in an array is given below.
Let denote the length of the longest monotonically increasing sequence starting at index in the array.
Initialize .
For all such that :
Finally the length of the longest monotonically increasing sequence is .
Which of the following statements is TRUE?
Consider the languages , and as given below.
Which of the following statements is NOT TRUE?
Consider two binary operators '' and '' with the precedence of operator being lower than that of operator . Operator is right associative while operator is left associative. Which one of the following represents the parse tree for expression ?
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?
We are given a set of distinct elements and an unlabeled binary tree with nodes. In how many ways can we populate the tree with the given set so that it becomes a binary search tree?
Which one of the following options is CORRECT given three positive integers , and , and a predicate
Given , what will be the evaluation of the definite integral
Consider a database table containing two columns and each of type integer. After the creation of the table, one record is inserted in the table.
Let and denote the respective maximum values of and among all records in the table at any point in time. Using and , new records are inserted in the table 128 times with and values being , respectively. It may be noted that each time after the insertion, values of and 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;
Consider a finite sequence of random values . Let be the mean and be the standard deviation of . Let another finite sequence of equal length be derived from this as , where and are positive constants. Let be the mean and be the standard deviation of this sequence. Which one of the following statements is INCORRECT?
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?
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 | 4 ms |
| P2 | 2 ms | 9 ms |
The pre-emptive shortest job first scheduling algorithm is used. Scheduling is carried out only at arrival or completion of processes. What is the average waiting time for the three processes?
Consider evaluating the following expression tree on a machine with load-store architecture in which memory can be accessed only through load and store instructions. The variables and are initially stored in memory. The binary operators used in this expression tree can be evaluated by the machine only when the operands are in registers. The instructions produce result only in a register. If no intermediate results can be stored in memory, what is the minimum number of registers needed to evaluate this expression?
Which of the given options provides the increasing order of asymptotic complexity of functions and ?
Four matrices and of dimensions , , and respectively can be multiplied in several ways with different number of total scalar multiplications. For example when multiplied as , the total number of scalar multiplications is . When multiplied as , the total number of scalar multiplications is .
If , and , then the minimum number of scalar multiplications needed is
Consider a relational table with sufficient number of records, having attributes and let . Two queries Q1 and Q2 are given below.
Q1: where is a constant
Q2: where and are constants
The database can be configured to do ordered indexing on or hashing on . Which of the following statements is TRUE?
Consider the matrix as given below.
Which one of the following options provides the CORRECT values of the eigenvalues of the matrix?
Consider an instruction pipeline with four stages (S1, S2, S3 and S4) each with combinational circuit only. The pipeline registers are required between each stage and at the end of the last stage. Delays for the stages and for the pipeline registers are as given in the figure.
What is the approximate speed up of the pipeline in steady state under ideal conditions when compared to the corresponding non-pipeline implementation?
Definition of a language with alphabet is given as following.
What is the minimum number of states needed in a DFA to recognize ?
An 8KB direct-mapped write-back cache is organized as multiple blocks, each of size 32-bytes. The processor generates 32-bit addresses. The cache controller maintains the tag information for each cache block comprising of the following.
What is the total size of memory needed at the cache controller to store meta-data (tags) for the cache?
An application loads 100 libraries at startup. Loading each library requires exactly one disk access. The seek time of the disk to a random location is given as 10 ms. Rotational speed of disk is 6000 rpm. If all 100 libraries are loaded from random locations on the disk, how long does it take to load all libraries? (The time to transfer data from the disk block once the head has been positioned at the start of the block may be neglected.)
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
);
The following is the comment written for a C function.
/* This function computes the roots of a quadratic equation
a.x^2 + b.x + c = 0. The function stores two real roots
in *root1 and *root2 and returns the status of validity
of roots. It handles four different kinds of cases.
(i) When coefficient a is zero irrespective of discriminant
(ii) When discriminant is positive
(iii) When discriminant is zero
(iv) When discriminant is negative.
Only in case (ii) and (iii), the stored roots are valid.
Otherwise 0 is stored in the roots. The function returns
0 when the roots are valid and -1 otherwise.
The function also ensures root1 >= root2.
int get_QuadRoots(float a, float b, float c,
float *root1, float *root2);
*/
A software test engineer is assigned the job of doing black box testing. He comes up with the following test cases, many of which are redundant.
| Test Case | a | b | c | root1 | root2 | Return Value |
|---|---|---|---|---|---|---|
| T1 | 0.0 | 0.0 | 7.0 | 0.0 | 0.0 | -1 |
| T2 | 0.0 | 1.0 | 3.0 | 0.0 | 0.0 | -1 |
| T3 | 1.0 | 2.0 | 1.0 | -1.0 | -1.0 | 0 |
| T4 | 4.0 | -12.0 | 9.0 | 1.5 | 1.5 | 0 |
| T5 | 1.0 | -2.0 | -3.0 | 3.0 | -1.0 | 0 |
| T6 | 1.0 | 1.0 | 4.0 | 0.0 | 0.0 | -1 |
Which one of the following options provide the set of non-redundant tests using equivalence class partitioning approach from input perspective for black box testing?
Common Data for Questions 48 and 49:
Consider the following recursive C function that takes two arguments.
unsigned int foo(unsigned int n, unsigned int r) {
if (n > 0) return ((n % r) + foo(n / r, r));
else return 0;
}
What is the return value of the function foo when it is called as foo(345, 10)?
Common Data for Questions 48 and 49:
Consider the following recursive C function that takes two arguments.
unsigned int foo(unsigned int n, unsigned int r) {
if (n > 0) return ((n % r) + foo(n / r, r));
else return 0;
}
What is the return value of the function foo when it is called as foo(513, 2)?
If at some instance prior to the occurrence of the clock edge, and have a value 0, 1 and 0 respectively, what shall be the value of after the clock edge?
If all the flip-flops were reset to 0 at power on, what is the total number of distinct outputs (states) represented by generated by the counter?
Statement for Linked Answer Questions 52 and 53:
Consider a network with five nodes, N1 to N5, as shown below.
The network uses a Distance Vector Routing protocol. Once the routes have stabilized, the distance vectors at different nodes are as following:
N1:
N2:
N3:
N4:
N5:
Each distance vector is the distance of the best known path at that instance to nodes, N1 to N5, where the distance to itself is 0. Also, all links are symmetric and the cost is identical in both directions. In each round, all nodes exchange their distance vectors with their respective neighbors. Then all nodes update their distance vectors. In between two rounds, any change in cost of a link will cause the two incident nodes to change only that entry in their distance vectors.
The cost of link N2-N3 reduces to 2 (in both directions). After the next round of updates, what will be the new distance vector at node, N3?
Statement for Linked Answer Questions 52 and 53:
Consider a network with five nodes, N1 to N5, as shown below.
The network uses a Distance Vector Routing protocol. Once the routes have stabilized, the distance vectors at different nodes are as following:
N1:
N2:
N3:
N4:
N5:
Each distance vector is the distance of the best known path at that instance to nodes, N1 to N5, where the distance to itself is 0. Also, all links are symmetric and the cost is identical in both directions. In each round, all nodes exchange their distance vectors with their respective neighbors. Then all nodes update their distance vectors. In between two rounds, any change in cost of a link will cause the two incident nodes to change only that entry in their distance vectors.
After the update in the previous question, the link N1-N2 goes down. N2 will reflect this change immediately in its distance vector as cost, . After the NEXT ROUND of update, what will be the cost to N1 in the distance vector of N3?
What will be the cost of the minimum spanning tree (MST) of such a graph with nodes?
The length of the path from to in the MST of previous question with is
Which of the following options is the closest in the meaning to the word below:
Inexplicable
If , then which of the following options is TRUE?
Choose the most appropriate word(s) from the options given below to complete the following sentence.
I contemplated _______ Singapore for my vacation but decided against it.
Choose the most appropriate word from the options given below to complete the following sentence.
If you are trying to make a strong impression on your audience, you cannot do so by being understated, tentative or _______.
Choose the word from the options given below that is most nearly opposite in meaning to the given word:
Amalgamate
Few school curricula include a unit on how to deal with bereavement and grief, and yet all students at some point in their lives suffer from losses through death and parting.
Based on the above passage which topic would not be included in a unit on bereavement?
P, Q, R and S are four types of dangerous microbes recently found in a human habitat. The area of each circle with its diameter printed in brackets represents the growth of a single microbe surviving human immunity system within 24 hours of entering the body. The danger to human beings varies proportionately with the toxicity, potency and growth attributed to a microbe shown in the figure below:
A pharmaceutical company is contemplating the development of a vaccine against the most dangerous microbe. Which microbe should the company target in its first attempt?
The variable cost () of manufacturing a product varies according to the equation , where is the quantity produced. The fixed cost () of production of same product reduces with according to the equation . How many units should be produced to minimize the total cost ()?
A transporter receives the same number of orders each day. Currently, he has some pending orders (backlog) to be shipped. If he uses 7 trucks, then at the end of the 4th day he can clear all the orders. Alternatively, if he uses only 3 trucks, then all the orders are cleared at the end of the 10th day. What is the minimum number of trucks required so that there will be no pending order at the end of the 5th day?
A container originally contains 10 litres of pure spirit. From this container 1 litre of spirit is replaced with 1 litre of water. Subsequently, 1 litre of the mixture is again replaced with 1 litre of water and this process is repeated one more time. How much spirit is now left in the container?
Not saved yet. Press Save & Next (or Mark for Review & Next) to record this selection.
M
Your answers are being marked.
The result page did not open. Your answers are saved in this browser.Open the result