Question 1 of 65
The representation of the value of a 16-bit unsigned integer in hexadecimal number system is . The representation of the value of in octal number system is
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.
The representation of the value of a 16-bit unsigned integer in hexadecimal number system is . The representation of the value of in octal number system is
Match the following:
| Item | Description |
|---|---|
(P) static char var; |
(i) Sequence of memory locations to store addresses |
(Q) m = malloc(10); m = NULL; |
(ii) A variable located in data section of memory |
(R) char *ptr[10]; |
(iii) Request to allocate a CPU register to store data |
(S) register int var1; |
(iv) A lost memory which cannot be freed |
Match the algorithms with their time complexities:
| Algorithm | Time complexity |
|---|---|
| (P) Towers of Hanoi with disks | (i) |
| (Q) Binary search given sorted numbers | (ii) |
| (R) Heap sort given numbers at the worst case | (iii) |
| (S) Addition of two matrices | (iv) |
Let be any two context-free languages and be any regular language. Then which of the following is/are CORRECT?
I. is context-free.
II. is context-free.
III. is context-free.
IV. is context-free.
Match the following according to input (from the left column) to the compiler phase (in the right column) that processes it:
| Input | Compiler Phase |
|---|---|
| (P) Syntax tree | (i) Code generator |
| (Q) Character stream | (ii) Syntax analyzer |
| (R) Intermediate representation | (iii) Semantic analyzer |
| (S) Token stream | (iv) Lexical analyzer |
Which of the following statements about parser is/are CORRECT?
I. Canonical LR is more powerful than SLR.
II. SLR is more powerful than LALR.
III. SLR is more powerful than Canonical LR.
Which of the following is/are shared by all the threads in a process?
I. Program counter
II. Stack
III. Address space
IV. Registers
In a file allocation system, which of the following allocation scheme(s) can be used if no external fragmentation is allowed?
I. Contiguous
II. Linked
III. Indexed
Consider the following statements about the routing protocols, Routing Information Protocol (RIP) and Open Shortest Path First (OSPF) in an IPv4 network.
I: RIP uses distance vector routing
II: RIP packets are sent using UDP
III: OSPF packets are sent using TCP
IV: OSPF operation is based on link-state routing
Which of the statements above are CORRECT?
If , and , then the constants and are, respectively
Let denote the statements “It is raining”, “It is cold”, and “It is pleasant”, respectively. Then the statement “It is not raining and it is pleasant, and it is not pleasant only if it is raining and it is cold” is represented by
Given the following binary number in 32-bit (single precision) IEEE-754 format:
00111110011011010000000000000000
The decimal value closest to this floating-point number is
A circular queue has been implemented using a singly linked list where each node consists of a value and a single pointer pointing to the next node. We maintain exactly two external pointers FRONT and REAR pointing to the front node and the rear node of the queue, respectively. Which of the following statements is/are CORRECT for such a circular queue, so that insertion and deletion operations can be performed in time?
I. Next pointer of front node points to the rear node.
II. Next pointer of rear node points to the front node.
Consider the following function implemented in C:
void printxy(int x, int y) {
int *ptr;
x = 0;
ptr = &x;
y = *ptr;
*ptr = 1;
printf("%d, %d", x, y);
}
The output of invoking printxy(1, 1) is
Identify the language generated by the following grammar, where is the start variable.
An ER model of a database consists of entity types A and B. These are connected by a relationship R which does not have its own attribute. Under which one of the following conditions, can the relational table for R be merged with that of A?
Consider socket API on a Linux machine that supports connected UDP sockets. A connected UDP socket is a UDP socket on which connect function has already been called. Which of the following statements is/are CORRECT?
I. A connected UDP socket can be used to communicate with multiple peers simultaneously.
II. A process can successfully call connect function again for an already connected UDP socket.
Consider the following tables T1 and T2.
Table T1
| P | Q |
|---|---|
| 2 | 2 |
| 3 | 8 |
| 7 | 3 |
| 5 | 8 |
| 6 | 9 |
| 8 | 5 |
| 9 | 8 |
Table T2
| R | S |
|---|---|
| 2 | 2 |
| 8 | 3 |
| 3 | 2 |
| 9 | 7 |
| 5 | 7 |
| 7 | 2 |
In table T1, P is the primary key and Q is the foreign key referencing R in table T2 with on-delete cascade and on-update cascade. In table T2, R is the primary key and S is the foreign key referencing P in table T1 with on-delete set NULL and on-update cascade. In order to delete record from table T1, the number of additional records that need to be deleted from table T1 is
A number: digits, one decimal point and an optional minus sign at the start.
The maximum number of IPv4 router addresses that can be listed in the record route (RR) option field of an IPv4 header is
A number: digits, one decimal point and an optional minus sign at the start.
Consider the set under the partial ordering
The Hasse diagram of the partial order is shown below.
The minimum number of ordered pairs that need to be added to to make a lattice is
A number: digits, one decimal point and an optional minus sign at the start.
Let and be two matrices.
Then the rank of is
A number: digits, one decimal point and an optional minus sign at the start.
is an undirected graph with vertices and 25 edges such that each vertex of has degree at least 3. Then the maximum possible value of is
A number: digits, one decimal point and an optional minus sign at the start.
Consider a quadratic equation with coefficients in a base . The solutions of this equation in the same base are and . Then
A number: digits, one decimal point and an optional minus sign at the start.
The minimum possible number of states of a deterministic finite automaton that accepts the regular language is
A number: digits, one decimal point and an optional minus sign at the start.
P and Q are considering to apply for a job. The probability that P applies for the job is , the probability that P applies for the job given that Q applies for the job is , and the probability that Q applies for the job given that P applies for the job is . Then the probability that P does not apply for the job given that Q does not apply for the job is
If are Boolean variables, then which one of the following is INCORRECT?
Given , where represents the don’t-care condition in Karnaugh maps. Which of the following is a minimum product-of-sums (POS) form of ?
In a two-level cache system, the access times of and caches are 1 and 8 clock cycles, respectively. The miss penalty from the cache to main memory is 18 clock cycles. The miss rate of cache is twice that of . The average memory access time (AMAT) of this cache system is 2 cycles. The miss rates of and respectively are:
Consider the recurrence function
Then in terms of notation is
For any discrete random variable , with probability mass function
define the polynomial function . For a certain discrete random variable , there exists a scalar such that . The expectation of is
Consider the following expression grammar :
Which of the following grammars is not left recursive, but is equivalent to ?
A system shares 9 tape drives. The current allocation and maximum requirement of tape drives for three processes are shown below:
| Process | Current Allocation | Maximum Requirement |
|---|---|---|
| P1 | 3 | 8 |
| P2 | 1 | 6 |
| P3 | 3 | 5 |
Which of the following best describes current state of the system?
Consider a binary code that consists of only four valid codewords as given below:
00000, 01011, 10101, 11110
Let the minimum Hamming distance of the code be and the maximum number of erroneous bits that can be corrected by the code be . Then the values of and are
Consider two hosts and , connected by a single direct link of rate bits/sec. The distance between the two hosts is km and the propagation speed along the link is m/sec. Host sends a file of bytes as one large message to host continuously. Let the transmission and propagation delays be milliseconds and milliseconds, respectively.
Then the values of and are
The pre-order traversal of a binary search tree is given by 12, 8, 6, 2, 7, 9, 10, 16, 15, 19, 17, 20. Then the post-order traversal of this tree is:
Consider the C program fragment below which is meant to divide by using repeated subtractions. The variables and are all unsigned int.
while (r >= y) {
r = r - y;
q = q + 1;
}
Which of the following conditions on the variables and before the execution of the fragment will ensure that the loop terminates in a state satisfying the condition x == (y*q + r)?
Consider the following C function.
int fun(int n) {
int i, j;
for (i = 1; i <= n; i++) {
for (j = 1; j < n; j += i) {
printf("%d %d", i, j);
}
}
}
Time complexity of fun in terms of notation is
Let denote the transition function and denote the extended transition function of the -NFA whose transition table is given below:
Then is
Consider the following languages.
Which of the following are CORRECT?
I. is context-free but not regular.
II. is not context-free.
III. is not context-free but recursive.
IV. is deterministic context-free.
Let be the language represented by regular expression . Let be the language generated by a context free grammar . Let be the language accepted by a Turing machine .
Which of the following decision problems are undecidable?
I. Given a regular expression and a string , is ?
II. Given a context-free grammar , is ?
III. Given a context-free grammar , is for some alphabet ?
IV. Given a Turing machine and a string , is ?
The next state table of a 2-bit saturating up-counter is given below.
| 0 | 0 | 0 | 1 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 1 |
| 1 | 1 | 1 | 1 |
The counter is built as a synchronous sequential circuit using T flip-flops. The expressions for and are
Consider the following snippet of a C program. Assume that swap(&x, &y) exchanges the contents of x and y.
int main() {
int array[] = {3, 5, 1, 4, 6, 2};
int done = 0;
int i;
while (done == 0) {
done = 1;
for (i=0; i<=4; i++) {
if (array[i] < array[i+1]) {
swap(&array[i], &array[i+1]);
done = 0;
}
}
for (i=5; i>=1; i--) {
if (array[i] > array[i-1]) {
swap(&array[i], &array[i-1]);
done = 0;
}
}
}
printf("%d", array[3]);
}
The output of the program is
A number: digits, one decimal point and an optional minus sign at the start.
Two transactions and are given as
where denotes a read operation by transaction on a variable and denotes a write operation by transaction on a variable . The total number of conflict serializable schedules that can be formed by and is
A number: digits, one decimal point and an optional minus sign at the start.
The read access times and the hit ratios for different caches in a memory hierarchy are as given below.
| Cache | Read access time (in nanoseconds) | Hit ratio |
|---|---|---|
| I-cache | 2 | 0.8 |
| D-cache | 2 | 0.9 |
| L2-cache | 8 | 0.9 |
The read access time of main memory is 90 nanoseconds. Assume that the caches use the referred-word-first read policy and the write back policy. Assume that all the caches are direct mapped caches. Assume that the dirty bit is always 0 for all the blocks in the caches. In execution of a program, 60% of memory reads are for instruction fetch and 40% are for memory operand fetch. The average read access time in nanoseconds (up to 2 decimal places) is
A number: digits, one decimal point and an optional minus sign at the start.
Consider the following database table named top_scorer.
| player | country | goals |
|---|---|---|
| Klose | Germany | 16 |
| Ronaldo | Brazil | 15 |
| G Müller | Germany | 14 |
| Fontaine | France | 13 |
| Pelé | Brazil | 12 |
| Klinsmann | Germany | 11 |
| Kocsis | Hungary | 11 |
| Batistuta | Argentina | 10 |
| Cubillas | Peru | 10 |
| Lato | Poland | 10 |
| Lineker | England | 10 |
| T Müller | Germany | 10 |
| Rahn | Germany | 10 |
Consider the following SQL query:
SELECT ta.player FROM top_scorer AS ta
WHERE ta.goals >ALL (SELECT tb.goals
FROM top_scorer AS tb
WHERE tb.country = 'Spain')
AND ta.goals >ANY (SELECT tc.goals
FROM top_scorer AS tc
WHERE tc.country = 'Germany')
The number of tuples returned by the above SQL query is
A number: digits, one decimal point and an optional minus sign at the start.
If the ordinary generating function of a sequence is , then is equal to
A number: digits, one decimal point and an optional minus sign at the start.
If a random variable has a Poisson distribution with mean 5, then the expectation equals
A number: digits, one decimal point and an optional minus sign at the start.
In a B+ tree, if the search-key value is 8 bytes long, the block size is 512 bytes and the block pointer size is 2 bytes, then the maximum order of the B+ tree is
A number: digits, one decimal point and an optional minus sign at the start.
A message is made up entirely of characters from the set . The table of probabilities for each of the characters is shown below:
| Character | Probability |
|---|---|
| P | 0.22 |
| Q | 0.34 |
| R | 0.17 |
| S | 0.19 |
| T | 0.08 |
| Total | 1.00 |
If a message of 100 characters over is encoded using Huffman coding, then the expected length of the encoded message in bits is
A number: digits, one decimal point and an optional minus sign at the start.
Consider the set of processes with arrival time (in milliseconds), CPU burst time (in milliseconds), and priority (0 is the highest priority) shown below. None of the processes have I/O burst time.
| Process | Arrival Time | Burst Time | Priority |
|---|---|---|---|
| 0 | 11 | 2 | |
| 5 | 28 | 0 | |
| 12 | 2 | 3 | |
| 2 | 10 | 1 | |
| 9 | 16 | 4 |
The average waiting time (in milliseconds) of all the processes using preemptive priority scheduling algorithm is
A number: digits, one decimal point and an optional minus sign at the start.
If the characteristic polynomial of a matrix over (the set of real numbers) is , , and one eigenvalue of is 2, then the largest among the absolute values of the eigenvalues of is
A number: digits, one decimal point and an optional minus sign at the start.
Consider a machine with a byte addressable main memory of bytes divided into blocks of size 32 bytes. Assume that a direct mapped cache having 512 cache lines is used with this machine. The size of the tag field in bits is
A number: digits, one decimal point and an optional minus sign at the start.
Consider the following C program.
#include <stdio.h>
int main() {
int m = 10;
int n, n1;
n = ++m;
n1 = m++;
n--;
--n1;
n -= n1;
printf("%d", n);
return 0;
}
The output of the program is
A number: digits, one decimal point and an optional minus sign at the start.
Consider the following C program.
#include <stdio.h>
#include <string.h>
int main() {
char* c = "GATECSIT2017";
char* p = c;
printf("%d", (int) strlen(c + 2[p] - 6[p] - 1));
return 0;
}
The output of the program is
A number: digits, one decimal point and an optional minus sign at the start.
Choose the option with words that are not synonyms.
Saturn is ________ to be seen on a clear night with the naked eye.
There are five buildings called V, W, X, Y and Z in a row (not necessarily in that order). V is to the West of W. Z is to the East of X and the West of V. W is to the West of Y. Which is the building in the middle?
A test has twenty questions worth 100 marks in total. There are two types of questions. Multiple choice questions are worth 3 marks each and essay questions are worth 11 marks each. How many multiple choice questions does the exam have?
There are 3 red socks, 4 green socks and 3 blue socks. You choose 2 socks. The probability that they are of the same colour is
“We lived in a culture that denied any merit to literary works, considering them important only when they were handmaidens to something seemingly more urgent - namely ideology. This was a country where all gestures, even the most private, were interpreted in political terms.”
The author’s belief that ideology is not as important as literature is revealed by the word:
There are three boxes. One contains apples, another contains oranges and the last one contains both apples and oranges. All three are known to be incorrectly labelled. If you are permitted to open just one box and then pull out and inspect only one fruit, which box would you open to determine the contents of all three boxes?
is a 30 digit number starting with the digit 4 followed by the digit 7. Then the number will have
The number of roots of in the range is
An air pressure contour line joins locations in a region having the same atmospheric pressure. The following is an air pressure contour plot of a geographical region. Contour lines are shown at 0.05 bar intervals in this plot.
If the possibility of a thunderstorm is given by how fast air pressure rises or drops over a region, which of the following regions is most likely to have a thunderstorm?
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