Skip to content

GATE CS question library

Practise GATE CS Computer Science previous year questions free. Browse by subject, syllabus topic, year and question type, with answers and available solutions.

Subject, topic, year and type filter the full library. Match any choice within a filter, and all selected filter categories. Search, source and sort apply to this page.

20 on this page
Official PYQ2003Operating SystemMemory Management and Virtual MemoryMCQ · 1 mark
A processor uses 2-level\text{2-level} page tables for virtual to physical address translation. Page tables for both levels are stored in the main memory. Virtual and physical addresses are both 3232 bits wide. The memory is byte addressable. For virtual to physical address translation, the 1010 most significant bits of the virtual address are used as index …
Official PYQ2003Computer Organization and ArchitectureMachine Instructions and Addressing ModesMCQ · 1 mark
Consider the following assembly language program for a hypothetical processor A,B,A, B, and CC are 88 bit registers. The meanings of various instructions are shown as comments. MOV B, #0 ; B←0B \leftarrow 0 MOV C, #8 ; C←8C \leftarrow 8 Z: CMP C, #0 ; compare C with 0 JZ X ; jump to X if zero flag is set SUB C, #1 ; C←C−1C \gets C-1 RRC A, #1 ; right …
Official PYQ2003AlgorithmsSearching, Sorting, HashingMCQ · 1 mark
In a permutation a1…ana_1\ldots a_n, of nn distinct integers, an inversion is a pair (ai,aj)(a_i, a_j) such that i<ji < j and ai>aj.a_i > a_j. What would be the worst case time complexity of the Insertion Sort algorithm, if the inputs are restricted to permutations of 1...n1. . . n with at most nn inversions?
Official PYQ2003Compiler DesignRuntime EnvironmentsMCQ · 1 mark
The following program fragment is written in a programming language that allows global variables and does not allow nested declarations of functions. global int i=100, j=5; void P(x) { int i=10; print(x+10); i=200; j=20; print (x); } main() {P(i+j);} If the programming language uses dynamic scoping and call by name parameter passing mechanism, the values …
Official PYQ2003Operating SystemConcurrency and SynchronizationMCQ · 1 mark
Suppose we want to synchronize two concurrent processes PP and QQ using binary semaphores SS and TT. The code for the processes PP and QQ is shown below. …
Official PYQ2003Digital LogicCombinational CircuitsMCQ · 1 mark
Consider the following circuit composed of XOR gates and non-inverting buffers. The non-inverting buffers have delays δ1=2ns\delta_1 = 2 ns and δ2=4ns\delta_2 = 4 ns as shown in the figure. Both XOR gates and all wires have zero delays. Assume that all gate inputs, outputs, and wires are stable at logic level 00 at time 00. If the following waveform is …
Official PYQ2003Programming and Data StructuresBinary HeapsMCQ · 1 mark
In a min-heap with nn elements with the smallest element at the root, the 7th7^{th} smallest element can be found in time
Official PYQ2003Programming and Data StructuresLinked ListsMCQ · 1 mark
Consider the function ff defined below. struct item { int data; struct item * next; }; int f(struct item *p) { return ((p == NULL) || (p->next == NULL)|| ((p->data <= p ->next -> data) && f(p->next))); } For a given linked list pp, the function ff returns 11 if and only if
Official PYQ2003Programming and Data StructuresProgramming in CMCQ · 1 mark
Consider the C program shown below: #include<stdio.h> #define print(x) printf("%d", x) int x; void Q(int z) { z+=x; print(z); } void P(int *y) { int x = *y + 2; Q(x); *y = x - 1; print(x); } main(void) { x = 5; P(&x); print(x); } The output of this program is:
Official PYQ2003AlgorithmsAsymptotic Worst Case Time and Space ComplexityMCQ · 1 mark
In the following CC program fragment, jj, kk, nn and TwoLog_n are integer variables, and AA is an array of integers. The variable nn is initialized to an integer ⩾3\geqslant 3, and TwoLog_n is initialized to the value of 2∗⌈log⁡2(n)⌉2^*\lceil \log_2(n) \rceil for (k = 3; k <= n; k++) A[k] = 0; for (k = 2; k <= TwoLog_n; k++) for (j = k+1; j …
Official PYQ2003DatabasesTransactions and Concurrency ControlMCQ · 1 mark
Consider three data items D1,D2,D1, D2, and D3,D3, and the following execution schedule of transactions T1,T2,T1, T2, and T3.T3. In the diagram, R(D)R(D) and W(D)W(D) denote the actions reading and writing the data item DD respectively. …
Official PYQ2003DatabasesTuple Calculus and SQLMCQ · 1 mark
Consider the set of relations shown below and the SQL query that follows. Students: (Roll_number, Name, Date_of_birth) Courses: (Course_number, Course_name, Instructor) Grades: (Roll_number, Course_number, Grade) Select distinct Name from Students, Courses, Grades where Students.Roll_number=Grades.Roll_number and Courses.Instructor = 'Korth' and …
Official PYQ2003DatabasesNormal FormsMCQ · 1 mark
Consider the following functional dependencies in a database. …
Official PYQ2003Computer NetworksTransport Layer: Flow Control, Congestion Control, UDP, TCP, SocketsMCQ · 1 mark
Host AA is sending data to host BB over a full duplex link. AA and BB are using the sliding window protocol for flow control. The send and receive window sizes are 55 packets each. Data packets (sent only from AA to BB) are all 10001000 bytes long and the transmission time for such a packet is 5050 μsμs. Acknowledgment packets (sent …
Official PYQ2003Computer NetworksData Link Layer: Framing, Error Detection, MAC, Ethernet BridgingMCQ · 1 mark
A 22 kmkm long broadcast LAN has 10710^7 bps bandwidth and uses CSMA/CD. The signal travels along the wire at 2×1082 \times 10^8 m/s. What is the minimum packet size that can be used on this network?
Official PYQ2003Computer NetworksFragmentation and IP Addressing, IPv4, CIDRMCQ · 1 mark
The subnet mask for a particular network is 255.255.31.0.255.255.31.0. Which of the following pairs of IP\text{IP} addresses could belong to this network?
Official PYQ2003Operating SystemConcurrency and SynchronizationMCQ · 1 mark
Suppose we want to synchronize two concurrent processes PP and QQ using binary semaphores SS and TT. The code for the processes PP and QQ is shown below. Process P: Process Q: while(1){ W: print '0'; print '0'; X: } while(1){ Y: print '1'; print '1'; Z: } Synchronization statements can be inserted only at points W,X,Y,W, X, Y, and ZZ Which …
Official PYQ2003Operating SystemCPU SchedulingMCQ · 1 mark
A uni-processor computer system only has two processes, both of which alternate 1010 ms\text{ms} CPU bursts with 9090 ms\text{ms} I/O bursts. Both the processes were created at nearly the same time. The I/O of both processes can proceed in parallel. Which of the following scheduling strategies will result in the least CPU utilization (over a long …
Official PYQ2003Compiler DesignRuntime EnvironmentsMCQ · 1 mark
Which of the following is NOT an advantage of using shared, dynamically linked libraries as opposed to using statistically linked libraries?
Official PYQ2003Programming and Data StructuresProgramming in CMCQ · 1 mark
Consider the following class definitions in a hypothetical Object Oriented language that supports inheritance and uses dynamic binding. The language should not be assumed to be either Java or C++, though the syntax is similar. Class P { Class Q subclass of P { void f(int i) { void f(int i) { print(i); print(2*i); } } } } Now consider the following program …