All questions of Practice Test: Full Length for Computer Science Engineering (CSE) Exam

I was ___ ___  for the bus and then I ___ sight of Craig passing by.
  • a)
    Here, waiting, cot
  • b)
    There, waiting, caught
  • c)
    Here, weighting, caught
  • d)
    Hare, waiting, caught
Correct answer is option 'B'. Can you explain this answer?

Rohan Shah answered
The word 'here' and 'there' both can be used here but should be followed with 'waiting' as no other word can fit here. The word 'caught' is correct here as 'catch a sight' means 'to see something.' Option 2 thus has the correct combination of words. The word 'cot' means 'a small bed with high barred sides for a baby or very young child.'

Consider a relation A with n elements. What is the total number of relations which can be formed on A which are irreflexive?
  • a)
  • b)
  • c)
    2n
  • d)
Correct answer is option 'A'. Can you explain this answer?

Ravi Singh answered
A relation  on a set  is irreflexive provided that no element is related to itself; in other words,  for no  in .
An irreflexive relation contains (n2 - n) elements.
Therefore, number of irreflexive relations =

If we increase the sides of a rectangular park by 20% , then, what is the total increase in the area of that park ?
  • a)
    21 %
  • b)
    33 %
  • c)
    42 %
  • d)
    44 %
Correct answer is option 'D'. Can you explain this answer?

Let length of park = L and breadth of park = B Original Area = BL m2 New Length = 120L/100 = 6L/5 New Breadth = 120B/100 = 6B/5 New Area = 36LB/25 m2 so, Change in area = New – Original = 11LB/25 m2 % increase = Change / original * 100 = 44%

There are 5 brothers in a family. All were born at a gap of 3 years. If the sum total of ages of 5 brothers is 100. What is the age of 2nd most elder brother ?
  • a)
    13
  • b)
    15
  • c)
    23
  • d)
    26
Correct answer is option 'C'. Can you explain this answer?

Let the age of youngest brother be x
Then, x + (x + 3) + (x + 6) + (x + 9) + (x + 12) = 100 => 5x = 70 => x = 14
Therefore, age of 2nd most elder brother = 14 + 9 = 23.

A digital computer has a memory unit of 256k x 16 and a cache memory of 4k words. The cache uses direct mapping with a block size of 16 words.
 
Q. How many bits are there in index, tag, block and words fields of address format ?
  • a)
    10, 6, 8, 2
  • b)
    12, 6, 8, 4
  • c)
    12, 8, 6, 4
  • d)
    10, 6, 8, 4
Correct answer is option 'B'. Can you explain this answer?

Rajeev Sharma answered
Main Memory has 256k = 2^8 x 2^10 = 2^18.
i.e. We need 18 bits to address main memory.
Cache Memory has 4k = 2^2 x 2^10 = 2^12.
i.e. We need 12 bits to address cache memory.
Cache consists of Index and tag which together are used to address main memory location.
Here Index is 12 bits and tag is 6 bits. (18 – 12 = 6).
Index is divided into block part and word part. Block part is used to address blocks in cache and word part addresses individual word in a block.
Here a block size is 16 words. i.e. 2^4, we need 4 bits to address a word and 12 – 4 = 8 bits to address a block in cache memory.

Find the subnet address for the IP address 165.81.35.120 and subnet mask is 255.255.192.0.
  • a)
    255.255.0.0
  • b)
    165.81.192.0
  • c)
    165.81.0.0
  • d)
    165.81.35.0
Correct answer is option 'C'. Can you explain this answer?

Gate Gurus answered
IP address → 165.81.35.120 → 10100101 01010001 00100011 01111000
Subnet mask → 255.255.192.0 → 11111111 11111111 11000000 00000000
IP address                   10100101 01010001 00100011 01111000
Subnet mask               11111111 11111111 11000000 00000000
Subnet address           10100101 01010001 00000000 00000000
Subnet address → 10100101 01010001 00000000 00000000 → 165.81.0.0

The 32 bit floating point representation of (-12) is ___
  • a)
    11000000010000000000000000000000
  • b)
    11000001010000000000000000000000
  • c)
    01000001110000000000000000000000
  • d)
    11000000110000000000000000000000
Correct answer is option 'B'. Can you explain this answer?

To convert the floating point into decimal, we have 3 elements in a 32-bit floating point representation:
Sign (MSB)
Exponent (8 bits after MSB)
Mantissa (Remaining 23 bits)
Sign bit is the first bit of the binary representation. ‘1’ implies negative number and ‘0’ implies positive number. Sign bit=1
Exponent is decided by the next 8 bits of binary representation.
Hence the exponent of 2 will be 3. i.e 23=8.
127 is the unique number for 32 bit floating point representation. It is known as bias. It is determined by 2k-1-1 where ‘k’ is the number of bits in exponent field.
Thus bias = 127 for 32 bit. (28-1-1 = 128-1=127)
127+3=130 i.e. 10000010 in binary representation.
Mantissa: 12 in binary = 1100
Move the binary point so that there is only one bit from the left. Adjust the exponent of 2 so that the value does not change. This is normalizing the number.
1.100 x 23
10000000000000000000000
Thus the floating point representation of -12 is
1 10000010 10000000000000000000000

Let L1 be a regular language, L2 be a deterministic context-free language and L3 a recursively enumerable but not recursive language.
Which one of the following statements is false?
  • a)
    L1 ∩ L2 is a deterministic CFL
  • b)
    L3 ∩ L1 is recursive
  • c)
    L1. L2 is context free
  • d)
    L1∩ L2∩ L3 is recursively enumerable
Correct answer is option 'B'. Can you explain this answer?

Anagha Chopra answered
Explanation:

To determine which of the given statements is false, let's analyze each option one by one.

Option 'a': L1 ∩ L2 is a deterministic CFL

The intersection of a regular language (L1) and a deterministic context-free language (L2) can be either regular or context-free. Since both regular languages and deterministic context-free languages are closed under intersection, the intersection of L1 and L2 will also be either regular or deterministic context-free.

Therefore, option 'a' is true.

Option 'b': L3 ∩ L1 is recursive

The intersection of a recursively enumerable language (L3) and a regular language (L1) can be either recursively enumerable or recursive. However, the option states that L3 ∩ L1 is recursive, which may not always be true. It is possible for the intersection to be recursively enumerable but not recursive.

Therefore, option 'b' is false.

Option 'c': L1 . L2 is context free

The concatenation of a regular language (L1) and a deterministic context-free language (L2) will always result in a context-free language. Regular languages are a subset of context-free languages, and the concatenation operation preserves the context-free property.

Therefore, option 'c' is true.

Option 'd': L1 ∩ L2 ∩ L3 is recursively enumerable

The intersection of three languages, L1, L2, and L3, can be recursively enumerable. Since recursively enumerable languages are closed under intersection, the intersection of L1, L2, and L3 will also be recursively enumerable.

Therefore, option 'd' is true.

In summary, the false statement is option 'b': L3 ∩ L1 is recursive.

The number of 4 line to-16 line decoders required to make an 8-line-to-256 line decoder is
  • a)
    12
  • b)
    17
  • c)
    23
  • d)
    35
Correct answer is option 'B'. Can you explain this answer?

8-line to-256-line decoder using 4-line to-16-line decoders is shown below
Number of 4 x 16 MUX required
= 256 / 16 + 16/16 = 16 + 1 = 17

A system has 3 resources and 5 processes competing for them. Each process can request a maximum of N instances. The largest value of N that will always avoid deadlock is _______.
    Correct answer is '1'. Can you explain this answer?

    Aaditya Ghosh answered
    Distribute each process to one less than maximum request resources i.e. 5(N - 1)
    Total no. of resources = 5(N - 1) + 1 = 5N - 2
    If total no. resources are greater than given resources then a deadlock will occur.
    5N – 2 <= 3
    5N <= 5
    N <= 1

    A directed acyclic graph represents one form of intermediate representation. The number of non terminal nodes in DAG of a = (b+c)*(b+c) expression is:
    • a)
      2
    • b)
      3
    • c)
      4
    • d)
      5
    Correct answer is option 'B'. Can you explain this answer?

    Shanaya Chopra answered
    Explanation:

    DAG: A directed acyclic graph (DAG) is a graph that is directed and without cycles connecting the other edges. This means that it is impossible to traverse the entire graph starting from one edge.

    (b c)*(b c): This expression can be represented in the form of a DAG. Let's understand this expression and its DAG representation step by step.

    Step 1: First, we need to find the non-terminal nodes of the expression. In this expression, we have two non-terminal nodes: (b c) and (b c).

    Step 2: Now, we need to find the operations performed on these non-terminal nodes. In this case, the operation performed on these non-terminal nodes is the Kleene closure (*).

    Step 3: The Kleene closure is applied to each of the non-terminal nodes, resulting in two new non-terminal nodes: (b c)* and (b c)*.

    Step 4: Finally, we need to find the operation performed on these two new non-terminal nodes. In this case, the operation performed on these two new non-terminal nodes is the concatenation operation. This results in a final non-terminal node.

    Therefore, the total number of non-terminal nodes in the DAG of the expression (b c)*(b c) is 3.

    Hence, the correct answer is option B.

    Given a graph G (V, E) is Bipartite, what is the chromatic number of G ?
    • a)
      2
    • b)
      3
    • c)
    • d)
      Can't be decided
    Correct answer is option 'A'. Can you explain this answer?

    Since the graph G is bipartite, the vertices set V can be partitioned into two disjoint sets. This shows that we can color the graph with 2 colors such that no two adjacent vertices will have same color.

    What is the number missing from the table?
    • a)
      45
    • b)
      48
    • c)
      51
    • d)
      54
    Correct answer is option 'B'. Can you explain this answer?

    Shounak Sharma answered
    XY + Z = X(Y + Z)
    ⇒ XY + Z = XY + XZ
    ⇒ Z = XZ ⇒ Z - XZ = 0 ⇒ Z (1 - X) = 0
    Either Z = 0 (in this case X can take any value) OR X = 1 (in this case Z can take any value).
    X = 1 or Z = 0
    5 × 3 + 1 = 16
    16 × 3 + 1 = 49
    9 × 3 + 2 = 29
    29 × 3 + 2 = 89
    15 × 3 + 3 = 48
    48 × 3 + 3 = 147

    The minimum number of bits required to represent - 64 in 2’s complement representation is _________.
      Correct answer is '7'. Can you explain this answer?

      Yash Patel answered
      Whenever a number is in 2n form then the minimal 2’s complement representation is 1 followed by n number of zeros.
      So, – 64 = – 26 = 1000000

      A sum of Rs. 400 amounts to Rs. 480 in 4 years. What will it amount to if the rate of interest is increased by 2 % for the same time?
      • a)
        Rs. 512
      • b)
        520Rs.
      • c)
        Rs.490
      • d)
        Rs.515
      Correct answer is option 'A'. Can you explain this answer?

      Sanvi Kapoor answered
      We know that, S.I = P x R x T / 100
      A = S.I + P
      480 = 5.1+400
      ⇒S.I = 480 − 400 = 80
      ⇒S.I = P × R × T100
      ⇒80 = 400 × R × 4100
      ⇒R = 5%
      Now rate is increased by 2% So, new rate is 7% New S.I=400 × 7 × 4 / 100 = Rs.112
      New Amount = S.I + P = 112 + 400 = Rs.512

      X, Y and Z are the three contestants in one km race. If X can give Y a start of 52 metres and X can also give Z a start of 83 metres, how many metres start Y can give Z?
      • a)
        33.3 m
      • b)
        33 m
      • c)
        32 m
      • d)
        32.7 m
      Correct answer is option 'D'. Can you explain this answer?

      Ravi Singh answered
      While X runs 1000 metre, Y runs (1000-52) = 948 metre and Z runs (1000-83) = 917 metre
      i.e., when Y runs 948 metre, Z runs 917 metre
      ⇒ When Y runs 1000 metre, Z runs 917/948 x 1000 = 967.30 metre
      i.e., Y can give Z (1000-967.30) = 32.7 metre

      Mean of 12 observation was found to be 28. Later on, it was detected that an observation 62 was misread as 26. Then the correct mean of the observations is
      • a)
        28
      • b)
        31
      • c)
        33
      • d)
        36
      Correct answer is option 'B'. Can you explain this answer?

      Soumya Dey answered
      Given, mean of 12 observation was found to be 28.
      Mean = sum of observations/number of observations.
      Sum of observations = 12 × 28 = 336
      Now, it was detected that an observation 62 was misread as 26.
      ∴ Correct mean = 

      WiFi is :
      • a)
        Simplex
      • b)
        Full Duplex
      • c)
        Half Duplex
      • d)
        None of the above
      Correct answer is option 'C'. Can you explain this answer?

      **WiFi is Half Duplex**

      **Explanation:**

      **1. Understanding Duplex Communication:**

      Duplex communication refers to the ability of a communication system to transmit and receive data simultaneously. There are three types of duplex communication:

      - Simplex: In simplex communication, data can only be transmitted in one direction. This means that the communication is unidirectional, and there is no capability for receiving data.

      - Half Duplex: In half-duplex communication, data can be transmitted in both directions, but not simultaneously. This means that the communication is bidirectional, but only one device can transmit at a time, while the other device can only receive.

      - Full Duplex: In full-duplex communication, data can be transmitted in both directions simultaneously. This means that the communication is bidirectional, and both devices can transmit and receive data at the same time.

      **2. WiFi Communication:**

      WiFi, also known as Wireless Fidelity, is a wireless communication technology that allows devices to connect to a local area network (LAN) or the internet without the need for physical wired connections. It uses radio waves to transmit and receive data.

      **3. WiFi as Half Duplex:**

      WiFi operates in the half-duplex mode, which means that it can transmit and receive data, but not simultaneously. This is due to the nature of the WiFi protocol and the shared medium through which data is transmitted.

      - WiFi uses a carrier sense multiple access with collision avoidance (CSMA/CA) protocol. This protocol ensures that multiple devices can share the same wireless channel without causing collisions.

      - In WiFi, devices take turns transmitting data. When a device wants to transmit, it listens to the channel to check if it is idle. If the channel is busy, the device waits for a random period of time before attempting to transmit again.

      - While a device is transmitting data, other devices must wait until the channel is free before they can transmit. This introduces a delay and prevents simultaneous transmission and reception.

      - This behavior is necessary to avoid collisions and ensure reliable communication in a shared wireless environment.

      **Conclusion:**

      In conclusion, WiFi operates in the half-duplex mode. While it can transmit and receive data, it cannot do so simultaneously. This is due to the CSMA/CA protocol used in WiFi, which ensures fair access to the shared wireless channel and prevents collisions.

      What is the output of the following C code?
      int main( )
      {
        auto int i=6; 
      {
          auto int i=7; 
      {
            auto int i=8;
            printf ( "\n%d ", i ) ; 
      }
      printf ( "%d ", i ) ; 
      }
      printf ( "%d", i ) ; 
      }
      • a)
         6 7 8
      • b)
        6 6 6
      • c)
        8 8 8
      • d)
        8 7 6
      Correct answer is option 'C'. Can you explain this answer?

      The Compiler treats the three i’s as totally different variables, since they are defined in different blocks. Once the control comes out of the innermost block the variable i with value 6 is lost, and hence the i in the second printf( ) refers to i with value 7. Similarly, when the control comes out of the next innermost block, the third printf( ) refers to the i with value 8.

      Consider the following weighted graph. Bellman-Ford algorithm is implemented on the given graph with source P. The shortest distance from source P to vertex T is ______.
        Correct answer is '2'. Can you explain this answer?

        Ananya Kumari answered
        Consider the following weighted graph . bellman - Ford algorithm is implemented on the given on the given graph with source p. the shortest distance from source p to verte lx T is ans

        2 and -1 and 2 or 1 about -1 and 1 or 2 the 3
        ans 2

        The regular expression which represents the set of strings in which every 0 is immediately followed by at least two 1's is ____________.
        • a)
          (011)*
        • b)
          (1+011)*
        • c)
          011*
        • d)
          (011 + 01)*
        Correct answer is option 'B'. Can you explain this answer?

        Dishani Bajaj answered
        If w is in L, then either
        (a) w does not contain any 0, or
        (b) it contains a 0 followed by 11. So, w can be written as w1w2.........wn, where each wi is either 0 or 011.
        So, L is represented by the regular expression (1 + 011)*.
        Therefore, option 2 is the correct answer.

        Direction: Study the information carefully to answer the questions that follow.
        In Vimla public school, students can choose among three sports Cricket, Football and Hockey. Out of 1000 students, each one is required to play at least one of the three sports. 40 students play all three sports. 380 students play only Hockey, 170 students play only Cricket, 60 students play exactly two sports Hockey and cricket and 240 students play only Football.
        What is the number of students who play exactly two sports?
        • a)
          155
        • b)
          170
        • c)
          200
        • d)
          140
        Correct answer is option 'B'. Can you explain this answer?

        Sarita Yadav answered
        It is given that the total number of students are = 1000
        Only Hockey = 380
        Only Cricket = 170
        Only Football = 240
        Hockey + Cricket + Football = 40 {all the three sports}
        Now, let X be the number of students who play Cricket and Football.
        And Y is the number of students who play football and hockey.
        Now total number of students,
        170 +60 +40 +380+ 240+ X + Y= 1000
        X + Y = 110
        And 60 students play only hockey and cricket, and that number we get after removing students who play all three sports from students who play hockey and cricket.
        X + Y + 60 = 110+ 60 = 170
        There are 170 students who play exactly two sports.

        What will the output of the following C code ?
        • a)
          1
        • b)
          2
        • c)
          3
        • d)
          4
        Correct answer is option 'A'. Can you explain this answer?

        Vedika Singh answered
        Consider the while loop condition => i + 1 ? --i : j++ In first iteration : i + 1 = 3 (true) So ternary operator will return --i i.e. 1, condition part is 1 means true so while condition is true. Hence printf statement will print 1 In second iteration : i + 1 =2 (true) So ternary operator will return --i i.e 0, condition part is 0 means false so while condition is false. Hence program control will come out of the while loop.

        Chapter doubts & questions for Practice Test: Full Length - GATE Computer Science Engineering(CSE) 2026 Mock Test Series 2026 is part of Computer Science Engineering (CSE) exam preparation. The chapters have been prepared according to the Computer Science Engineering (CSE) exam syllabus. The Chapter doubts & questions, notes, tests & MCQs are made for Computer Science Engineering (CSE) 2026 Exam. Find important definitions, questions, notes, meanings, examples, exercises, MCQs and online tests here.

        Chapter doubts & questions of Practice Test: Full Length - GATE Computer Science Engineering(CSE) 2026 Mock Test Series in English & Hindi are available as part of Computer Science Engineering (CSE) exam. Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free.

        Top Courses Computer Science Engineering (CSE)