GATE 2024 (Session 1) Computer Science and Information Technology (CS) Questions with Solutions

GATE 2024 (Session 1)

65 questions

MCQ 29 · MSQ 20 · NAT 161-mark 30 · 2-mark 35

Questions 16–20 of 65

Q16Application Layer Protocols1 markMCQ−0.33 if wrong
A user starts browsing a webpage hosted at a remote server. The browser opens a single TCP connection to fetch the entire webpage from the server. The webpage consists of a top-level index page with multiple embedded image objects. Assume that all caches (e.g., DNS cache, browser cache) are all initially empty. The following packets leave the user's computer in some order.

(i) HTTP GET request for the index page
(ii) DNS request to resolve the web server's name to its IP address
(iii) HTTP GET request for an image object
(iv) TCP SYN to open a connection to the web server

Which one of the following is the CORRECT chronological order (earliest in time to latest) of the packets leaving the computer ?

Q17Asymptotic Notation1 markMCQ−0.33 if wrong
Given an integer array of size NN, we want to check if the array is sorted (in either ascending or descending order). An algorithm solves this problem by making a single pass through the array and comparing each element of the array only with its adjacent elements. The worst-case time complexity of this algorithm is

Q18Arithmetic Operation1 markMCQ−0.33 if wrong
Consider the following C program:

#include <stdio.h>
int main(){
int a = 6;
int b = 0;
while(a < 10) {
a = a / 12 + 1;
a += b;}
printf("%d", a);
return 0;}
Which one of the following statements is CORRECT?

Q19Function1 markMCQ−0.33 if wrong
Consider the following C program:

#include <stdio.h>
void fX();
int main(){
fX();
return 0;}

void fX(){
char a;
if((a=getchar()) != '\n')
fX();
if(a != '\n')
putchar(a);}
Assume that the input to the program from the command line is 1234 followed by a newline character. Which one of the following statements is CORRECT?

Q20ER Model1 markMCQ−0.33 if wrong
Let S be the specification: "Instructors teach courses. Students register for courses. Courses are allocated classrooms. Instructors guide students." Which one of the following ER diagrams CORRECTLY represents S?
Instructor Teaches Course Registration Student Classroom Allocation Guides Instructor Teaches Course Classroom Allocation Registration Guides Projects Instructor Teaches Course Classroom Allocation Registration Guides Student Instructor Teaches Course Classroom Allocation Registration Guides Student (i) (ii) (iii) (iv)