Skip to content
GATEiit

All subjects · 3 December 2026

GATE CS 2027 | 25-30 Questions Daily - 03-12-2026

GATE CS 2027 | 25-30 Questions Daily - 03-12-2026 - www.gateiit.in

25 questions · PDF 141 KB · practise free, log in to save answers and take the timed exam · GATE CSE syllabus

Engineering Mathematics

  1. Question 1MSQ · 1 mark

    Let G be a finite group of order 24. Let H and K be subgroups of G with |H| = 8 and |K| = 6, where |S| denotes the number of elements of a set S. The set HK is defined as { hk | h belongs to H, k belongs to K }. Which of the following statements are necessarily TRUE?

    Select one or more options
    Log in to save your answerCheck answer opens 4 Dec, 12:00 am IST
  2. Question 2HardMCQ · 1 marklinear-algebra

    Let A be a real 4 × 4 matrix satisfying A3 − 6A2 + 11A − 6I = O, rank(A − 2I) = 3 and rank(A − 3I) = 3, where I is the identity matrix and O is the zero matrix. What is the value of det(A5)?

    Select one option
    Log in to save your answerCheck answer opens 4 Dec, 12:00 am IST
  3. Question 3AIR 1 ChallengeMCQ · 1 markprobability-and-statistics

    Let X1, X2 and X3 be independent random variables, each uniformly distributed over the interval [0, 1]. Define M = max(X1, X2, X3) and L = min(X1, X2, X3). Find the conditional probability P( M > 3/4 | L > 1/4 ).

    Select one option
    Log in to save your answerCheck answer opens 4 Dec, 12:00 am IST

Digital Logic

  1. Question 4HardMCQ · 1 mark

    A Boolean function of five variables, in which A is the most significant variable, is specified by F(A, B, C, D, E) = Σm(0, 2, 5, 7, 8, 10, 13, 15, 16, 18, 21, 23), with the don’t-care set d = Σm(1, 3, 17, 19, 24, 26). Here Σm denotes the sum of minterms and a prime (′) denotes the complement. Which of the following is the minimum-literal sum-of-products (SOP) expression for F?

    Select one option
    Log in to save your answerCheck answer opens 4 Dec, 12:00 am IST
  2. Question 5AIR 1 ChallengeMCQ · 1 mark

    A synchronous sequential circuit has two D flip-flops with state variables Q1 and Q0. Their next-state equations are: Next Q1 = Q0 Next Q0 = Q1 XNOR Q0 The initial state (Q1 Q0) is 00, and the output is Z = Q1 XOR Q0. What is the minimum positive number of clock cycles after which the complete sequence of states and outputs repeats?

    Select one option
    Log in to save your answerCheck answer opens 4 Dec, 12:00 am IST

Computer Organization and Architecture

  1. Question 6HardMCQ · 1 mark

    A processor has a 2-way set-associative cache with 2 sets and a block size of 1 word. The replacement policy is LRU, the write policy is write-back with write-allocate, and the cache is initially empty. A memory block with address x maps to set (x mod 2). The processor executes the following memory operations in order, where W and R denote a write and a read of the given memory block address, and every write modifies the cached block: W(0), R(2), W(4), R(0), W(6), R(2), W(8), R(4) A dirty block is written to main memory only when it is evicted, and the final cache contents are not flushed. What is the total number of main-memory block transfers, counting both block reads and dirty-block write-backs?

    Select one option
    Log in to save your answerCheck answer opens 4 Dec, 12:00 am IST
  2. Question 7AIR 1 ChallengeMCQ · 1 mark

    Consider a 5-stage pipeline with the stages IF, ID, EX, MEM and WB, and the following assumptions: • Full forwarding is available, including forwarding to the store-data input. • A load-use dependency (the instruction immediately after a load uses the loaded value) causes exactly one stall cycle. • A conditional branch is resolved in the EX stage and the prediction is always not-taken. When a branch is taken, the two younger instructions already fetched are flushed, and the branch target is fetched in the clock cycle immediately after the EX stage of the branch. • Separate instruction and data memories are used, there are no structural hazards, and every instruction, including MUL, spends exactly one clock cycle in each stage. The instruction sequence is: The branch in I6 is taken, so I9 is executed after I6. How many clock cycles are required from the first fetch of I1 until the completion of the WB stage of I10?

    I1: ADD R1, R2, R3
    I2: SUB R4, R1, R5
    I3: LW R6, 0(R4)
    I4: ADD R7, R6, R1
    I5: SW R7, 4(R4)
    I6: BEQ R7, R0, L
    I7: ADD R8, R8, R1
    I8: SUB R9, R9, R2
    L:
    I9: MUL R10, R1, R2
    I10: ADD R11, R10, R3
    Select one option
    Log in to save your answerCheck answer opens 4 Dec, 12:00 am IST

Programming and Data Structures

  1. Question 8HardMCQ · 1 markprogramming-data-structures-and-algorithms

    Consider the following C program: What is the output? (The first line of each option is the first line printed, and the second line is the second line printed.)

    #include <stdio.h>
    int solve(int *a, int n, int k) {
                    if (n <= 1)
                                    return n;
                    int x = a[k % n];
                    int i = 0, j = n - 1;
                    while (i <= j) {
                                    while (i < n && a[i] < x)
                                                    i++;
                                    while (j >= 0 && a[j] >= x)
                                                    j--;
                                    if (i < j) {
                                                    int t = a[i];
                                                    a[i] = a[j];
                                                    a[j] = t;
                                    }
                    }
                    int t = a[j + 1];
                    a[j + 1] = a[n - 1];
                    a[n - 1] = t;
                    int p = j + 1;
                    return p + solve(a, p, k + 1)
                                                        + solve(a + p + 1, n - p - 1, k + 2);
    }
    int main() {
                    int a[] = {7, 2, 9, 4, 6, 1, 8};
                    int r = solve(a, 7, 2);
                    printf("%d\n", r);
                    for (int i = 0; i < 7; i++)
                                    printf("%d ", a[i]);
                    return 0;
    }
    Select one option
    Log in to save your answerCheck answer opens 4 Dec, 12:00 am IST
  2. Question 9HardMCQ · 1 markartificial-intelligence

    A BST (binary search tree) is built by inserting the keys 50, 30, 70, 20, 40, 60, 80, 65, 60, 35, 45 in this order, using the following code. A key equal to an existing key is inserted into the right subtree. The following operations are then performed in order: What is the output of traverse(root)?

    struct Node {
        int key;
        struct Node *left, *right;
    };
    struct Node* insert(struct Node *root, int x) {
        if (root == NULL) {
            struct Node *p = malloc(sizeof(struct Node));
            p->key = x;
            p->left = p->right = NULL;
            return p;
        }
        if (x < root->key)
            root->left = insert(root->left, x);
        else
            root->right = insert(root->right, x);
        return root;
    }
    struct Node* minimum(struct Node *root) {
        while (root->left != NULL)
            root = root->left;
        return root;
    }
    struct Node* deleteNode(struct Node *root, int x) {
        if (root == NULL)
            return NULL;
        if (x < root->key)
            root->left = deleteNode(root->left, x);
        else if (x > root->key)
            root->right = deleteNode(root->right, x);
        else {
            if (root->left == NULL)
                return root->right;
            if (root->right == NULL)
                return root->left;
            struct Node *s = minimum(root->right);
            root->key = s->key;
            root->right = deleteNode(root->right, s->key);
        }
        return root;
    }
    void traverse(struct Node *root) {
        if (!root) return;
        printf("%d ", root->key);
        traverse(root->right);
        traverse(root->left);
    }
    root = deleteNode(root, 50);
    root = deleteNode(root, 60);
    root = deleteNode(root, 30);
    traverse(root);
    Select one option
    Log in to save your answerCheck answer opens 4 Dec, 12:00 am IST
  3. Question 10MSQ · 1 markprogramming-data-structures-and-algorithms

    Consider the following C program, in which the graph is undirected and the vertices are numbered from 0 to 6: DFS examines the neighbours of a vertex in increasing order of vertex number. Which of the following statements are TRUE?

    #include <stdio.h>
    #define N 7
    int adj[N][N] = {
        {0,1,1,0,0,0,0},
        {1,0,0,1,1,0,0},
        {1,0,0,1,0,1,0},
        {0,1,1,0,0,0,1},
        {0,1,0,0,0,1,1},
        {0,0,1,0,1,0,1},
        {0,0,0,1,1,1,0}
    };
    int visited[N] = {0};
    int parent[N];
    int entry[N], exitT[N];
    int timer = 0;
    void dfs(int u) {
        visited[u] = 1;
        entry[u] = ++timer;
        for (int v = 0; v < N; v++) {
            if (adj[u][v] && !visited[v]) {
                parent[v] = u;
                dfs(v);
            }
        }
        exitT[u] = ++timer;
    }
    int main() {
        for (int i = 0; i < N; i++)
            parent[i] = -1;
        for (int i = 0; i < N; i++)
            if (!visited[i])
                dfs(i);
        for (int i = 0; i < N; i++)
            printf("%d ", parent[i]);
        return 0;
    }
    Select one or more options
    Log in to save your answerCheck answer opens 4 Dec, 12:00 am IST

Algorithms

  1. Question 11HardMCQ · 1 markprogramming-data-structures-and-algorithms

    Consider the following C-like function, where max(x, y) returns the larger of x and y: The function is called with a = [8, 15, 3, 7, 10, 2] and n = 6. It models a game in which two players alternately pick either the leftmost or the rightmost remaining element, both play optimally, and the first player moves first. What value does solve(a, 6) return, that is, the maximum possible value of (first player’s total − second player’s total)?

    int solve(int a[], int n) {
        int dp[20][20] = {0};
        for (int i = 0; i < n; i++)
            dp[i][i] = a[i];
        for (int len = 2; len <= n; len++) {
            for (int i = 0; i + len <= n; i++) {
                int j = i + len - 1;
                dp[i][j] = max(
                    a[i] - dp[i+1][j],
                    a[j] - dp[i][j-1]
                );
            }
        }
        return dp[0][n-1];
    }
    Select one option
    Log in to save your answerCheck answer opens 4 Dec, 12:00 am IST
  2. Question 12MSQ · 1 markprogramming-data-structures-and-algorithms

    The following algorithm is run on a finite directed graph with non-negative edge weights and a source vertex s. Q is a min-priority queue. The algorithm has no visited array and never checks whether an extracted entry is stale. Which of the following statements are necessarily TRUE?

    dist[s] = 0;
    for every other vertex v: dist[v] = INF;
    insert (s, 0) into Q;
    while (Q is not empty) {
        (u, key) = extract_min(Q); // key is not checked
        for each edge (u, v, w) {
            if (dist[v] > dist[u] + w) {
                dist[v] = dist[u] + w;
                parent[v] = u;
                insert (v, dist[v]) into Q;
            }
        }
    }
    Select one or more options
    Log in to save your answerCheck answer opens 4 Dec, 12:00 am IST
  3. Question 13AIR 1 ChallengeMCQ · 1 markprogramming-data-structures-and-algorithms

    Each job has a start time, a finish time and a profit. Two jobs are compatible if one finishes no later than the other starts. Consider the following jobs: Job Start Finish Profit J1 1 4 8 J2 3 5 7 J3 4 6 6 J4 5 8 20 J5 6 9 10 J6 8 10 7 J7 9 11 12 J8 10 12 8 A greedy algorithm sorts the jobs by increasing finish time and selects a job whenever it is compatible with the jobs already selected, ignoring profit. What is the difference between the maximum total profit obtainable by an optimal algorithm and the total profit obtained by this greedy algorithm?

    Select one option
    Log in to save your answerCheck answer opens 4 Dec, 12:00 am IST

Theory of Computation

  1. Question 14HardMCQ · 1 mark

    Let Σ = {0, 1}. Define two languages: L1 = { w | the number of 0s in w is divisible by 3 } L2 = { w | the number of 1s in w is divisible by 4 } Let L = L1 ∩ L2. What is the minimum number of states required by a complete DFA that recognizes L?

    Select one option
    Log in to save your answerCheck answer opens 4 Dec, 12:00 am IST
  2. Question 15MSQ · 1 mark

    Let ATM = { ⟨M, w⟩ | Turing machine M accepts the input w }. Suppose a language L satisfies both of the following conditions: 1. ATM is many-one reducible to L by a computable reduction. 2. L is Turing-recognizable. Which of the following statements must be TRUE?

    Select one or more options
    Log in to save your answerCheck answer opens 4 Dec, 12:00 am IST

Compiler Design

  1. Question 16MSQ · 1 mark

    Consider the following control-flow graph, in which each basic block is shown below: All variables are scalars and assignments have no side effects, while input() and print() are observable operations. The graph has exactly the edges given by the jumps. Liveness is computed with the standard backward equations OUT[B] = union of IN[S] over all successors S of B, and IN[B] = USE[B] ∪ (OUT[B] − DEF[B]). Which of the following statements are correct at the fixed point?

    B1:
        a = input();
        b = 0;
        if (a > 0) goto B2; else goto B3;
    B2:
        c = a + b;
        d = c * 2;
        b = d - a;
        goto B4;
    B3:
        c = a - b;
        e = c + 5;
        goto B4;
    B4:
        if (b > 3) goto B2; else goto B5;
    B5:
        f = c + b;
        g = f + e;
        print(g);
    Select one or more options
    Log in to save your answerCheck answer opens 4 Dec, 12:00 am IST
  2. Question 17HardMCQ · 1 mark

    Consider the following grammar: S → L L → L1 ; E | E E → E1 + T | T T → T1 * F | F F → ( E ) | id Each id has a known value id.val supplied by the lexical analyzer. The semantic rules are: F → id F.val = id.val F → ( E ) F.val = E.val T → T1 * F T.val = T1.val × F.val T → F T.val = F.val E → E1 + T E.val = E1.val + T.val E → T E.val = T.val L → L1 ; E L.val = L1.val + E.val L → E L.val = E.val The input is: id1 * ( id2 + id3 ) ; id4 * id5 + id6, where the values are id1 = 2, id2 = 3, id3 = 4, id4 = 5, id5 = 2 and id6 = 7. What is the final value of S.val?

    Select one option
    Log in to save your answerCheck answer opens 4 Dec, 12:00 am IST

Operating Systems

  1. Question 18MSQ · 1 mark

    Three processes execute the following code. Initially x = 0 and y = 0 are shared variables, and the semaphores are initialized as shown: Semaphore operations are atomic, each assignment is atomic, the scheduler is fair among runnable processes, and no process is terminated externally. Which of the following statements are necessarily TRUE for every valid execution?

    semaphore S = 1;
    semaphore A = 0;
    semaphore B = 0;
    Process P1: Process P2: Process P3:
        wait(S); wait(A); wait(S);
        x = x + 1; x = x + 3; x = x + 5;
        signal(A); signal(B); signal(S);
        wait(B);
        y = x + 2;
        signal(S);
    Select one or more options
    Log in to save your answerCheck answer opens 4 Dec, 12:00 am IST
  2. Question 19MSQ · 1 mark

    A system has four processes P1, P2, P3 and P4 and three resource types A, B and C with total instances (10, 5, 7). All instances that are not currently allocated are available. The current allocation and maximum demand are: Allocation (A,Maximum (A, ProcessB, C)B, C) P1 0, 1, 0 7, 5, 3 P2 2, 0, 0 3, 2, 2 P3 3, 0, 2 9, 0, 2 P4 2, 1, 1 4, 2, 2 Which of the following statements are correct?

    Select one or more options
    Log in to save your answerCheck answer opens 4 Dec, 12:00 am IST
  3. Question 20AIR 1 ChallengeMCQ · 1 mark

    A process generates the following page reference string: 1, 2, 3, 4, 1, 2, 5, 1, 2, 3, 4, 5, 1, 2, 3, 4 The process is allocated 3 page frames, which are initially empty. Two page replacement algorithms are considered: LRU replaces the page whose most recent reference occurred farthest in the past, and OPT replaces the page whose next reference is farthest in the future. A page fault occurs whenever the referenced page is not in memory. What is the difference between the total number of page faults under LRU and under OPT?

    Select one option
    Log in to save your answerCheck answer opens 4 Dec, 12:00 am IST

Database Management Systems

  1. Question 21MSQ · 1 markdatabase-management-and-warehousing

    Consider the relations STUDENT(sid, name), COURSE(cid, dept) and ENROLL(sid, cid, grade). STUDENT.sid and COURSE.cid are primary keys, (sid, cid) is the primary key of ENROLL, the foreign keys reference the corresponding primary keys, and grade may be NULL. A student qualifies if the student is enrolled in every CSE course and none of those enrollments has a grade below 60. A NULL grade does not count as below 60. Which of the following SQL queries correctly return the sids of the qualifying students?

    Select one or more options
    Log in to save your answerCheck answer opens 4 Dec, 12:00 am IST
  2. Question 22MSQ · 1 markdatabase-management-and-warehousing

    Consider the relation R(A, B, C, D, E, F, G) with the following functional dependencies: { A → BC, B → D, CD → E, E → A, AF → G, G → F } Which of the following statements are correct?

    Select one or more options
    Log in to save your answerCheck answer opens 4 Dec, 12:00 am IST
  3. Question 23AIR 1 ChallengeMCQ · 1 markdatabase-management-and-warehousing

    Consider the following schedule S of three transactions T1, T2 and T3, where ri(X) and wi(X) denote a read and a write of X by transaction Ti: S: r1(X), w2(X), r3(X), w1(Y), r2(Y), w3(Y), r1(Z), w2(Z), w3(Z) All transactions commit after their listed operations, each transaction preserves the order of its own operations, and there are no other operations. Which of the following statements correctly characterizes the schedule?

    Select one option
    Log in to save your answerCheck answer opens 4 Dec, 12:00 am IST

Computer Networks

  1. Question 24MSQ · 1 mark

    An IPv4 datagram of total length 4000 bytes, including a 20-byte header, is sent through three consecutive links with MTUs of 1500, 620 and 400 bytes. Assume the following: • The IPv4 header has no options. • Every router fragments a datagram or fragment whenever necessary, independently for each incoming fragment. • All fragments keep the same Identification field. • The fragment offset is measured in units of 8 bytes. • The destination receives all fragments successfully. Which of the following statements are correct about the fragments arriving at the destination?

    Select one or more options
    Log in to save your answerCheck answer opens 4 Dec, 12:00 am IST
  2. Question 25AIR 1 ChallengeMCQ · 1 mark

    A TCP sender communicates with a receiver. The initial sequence number of the sender is 1000. The sender has already transmitted the bytes with sequence numbers 1000 through 4999, and the receiver has cumulatively acknowledged the bytes through sequence number 2999. There are no selective acknowledgments, retransmissions or duplicate ACKs, and the sender has no outstanding data beyond byte 4999. At this instant, the receiver advertises a new window of 8000 bytes and the congestion window of the sender becomes 6000 bytes. The sender uses the standard send-window rule: usable window = min(rwnd, cwnd) − FlightSize, where FlightSize is the number of transmitted bytes that are not cumulatively acknowledged. How many additional bytes can the sender transmit immediately without receiving another ACK?

    Select one option
    Log in to save your answerCheck answer opens 4 Dec, 12:00 am IST

More daily sets