All questions of Syllabus & Full Mock Tests for Computer Science Engineering (CSE) Exam

4 taps marked as T1, T2, T3 and T4 can fill a tank in 8 hours,12 hours, 16 hours and 24hours respectively. We have to fill up 2 identical tanks with 2 out of these 4 taps connected to tank 1 and remaining two taps connected to tank 2 so that the ratio of time taken to fill tank 1 and tank 2 is 2:3. so identify one of the pair of taps?
  • a)
    T1 and T2
  • b)
    T1 and T3
  • c)
    T2 and T3
  • d)
    T1 and T4
Correct answer is option 'B'. Can you explain this answer?

Arnav Gupta answered
Let us assume the capacity of the tank to be 48 units (48 being LCM of 8, 12, 16 and 24). This leads us to get the rate of filing of T1 to 4 as 6, 4, 3 and 2 units per hour.
Taking pairs of taps, we find that T1 + T2 will take 48/10 whereas the remaining pair will take 48/5 hours leading to the ratio of time taken to fill up 2 tanks as 5:10 which is not the required ratio.
Taking T1 and T3, the time taken is 48/9 and the time taken for the other tank is 48/6 leading to the required ratio as 2:3.
1 Crore+ students have signed up on EduRev. Have you? Download the App

A monkey is trying to reach the top of a tree. He climbs 3 feet in a minute but slides down by 1.5 feet after each climb. If he reaches the top of the tree in 58 minutes, then the maximum possible height of the tree is ____ feets.
  • a)
    85.0
  • b)
    87.3
  • c)
    88.5
  • d)
    90.1
Correct answer is option 'C'. Can you explain this answer?

Sanaya Chauhan answered
You have to carefully observe the point that in the last minute, we DO NOT have to consider the sliding down of the monkey since the question states that the monkey reaches the top of the tree.Out of 58 minutes, the climb by monkey in 58th minute is 3 feet whereas for each of his earlier climbs, the monkey covers a net distance of 3-1.5=1.5  feet.We can work out the maximum possible height of the tree as 1.5×57+3=85.5+3=88.5 feet

Find the output
#include <iostream>
#define cnct(x,y) x##y
using namespace std;
class {
public:
int p,q,pq;
int f1()
{
cout<<p+q+pq+cnct(p,q)<<endl;
return (p+++q);
}
}c;
int main(){
c.p=5,c.q=6,c.pq=15;
cout<<c.f1();
return 0;
}
  • a)
    Error occurs due to absence of class name
  • b)
    41,11
  • c)
    80,11
  • d)
    80,12
Correct answer is option 'B'. Can you explain this answer?

Ravi Singh answered
41, 11
Class without name is allowed. In this case object of class is created along with definition.
cnct(x,y) x##y ,## is a preprocessor macro used for concatenation.
x##y= xy
Call this creates a single terms named xy,here in main pq; cnct(p,q) places value of pq in its position that is 15.
cout<<p+q+pq+cnct(p,q)
5+6+15+15=41
P+++q is interpreted here as p++ + q(1st two for post increment operator,3rd one operator for adding )
Plus operator(+) has higher precedence than post increment operator. So, Value of p & q (5 & 6) get added before p increments. So, p+++q->11

In a trunk there are 3 types of ice cream of flavors vanilla, chocolate and blueberry. The probability of selecting one vanilla ice-cream is 12 and probability of selecting one blueberry ice-cream is 27. The total number of chocolate ice-cream is 6. Find the number of ice creams in the trunk:
  • a)
    25
  • b)
    30
  • c)
    28
  • d)
    32
Correct answer is option 'C'. Can you explain this answer?

Sudhir Patel answered
According to the question,
Let the ice cream of vanilla flavor be a.
Let the ice cream of blueberry ice cream be b.
Total number of ice cream = 6 + a + b
Probability (Selecting one vanilla ice cream) = 
⇒ Probability (Selecting one vanilla ice cream)  = 
 
Probability (Selecting one blue berry ice cream) = 
Solving equation (i) and (ii), we get
⇒a = 14 and b = 8
Total number of ice cream = 6 + 14 + 8
= 28
∴ Total number of ice cream in the trunk is 28.
Hence, the correct option is (C).

Consider the given statements:
Statement A: All cyclic groups are abelian groups.
Statement B: The order of the cyclic group is the same as the order of its generator.
Which of these are true/false?
  • a)
    A and B are false
  • b)
    A is true, B is false
  • c)
    B is true, A is false
  • d)
    A and B both are true
Correct answer is option 'D'. Can you explain this answer?

Sanya Agarwal answered
Abelian Group: Let {G=e, a, b} where e is identity. The operation 'o' is defined by the following composition table. Then(G, o) is called Abelian if it follows the following property:
  1. Closure Property
  2. Associativity
  3. Existence of Identity
  4. Existence of Inverse
  5. Commutativity
Cyclic Group: A group a is said to be cyclic if it contains an element 'a' such that every element of G can be represented as some integral power of 'a'. The element 'a' is then called a generator of G, and G is denoted by <a> (or [a]).
Theorem:
(i) All cyclic groups are Abelian, but an Abelian group is not necessarily cyclic.
(ii) The order of a cyclic group is the same as the order of its generator. 
Thus it is clear that A and B both are true.

How many separate address and data lines are needed for a memory of 8 K × 16 ?
  • a)
    13 address, 3 data lines
  • b)
    13 address, 16 data lines
  • c)
    12 address, 4 data lines
  • d)
    13 address, 4 data lines
Correct answer is option 'B'. Can you explain this answer?

Shanaya Chopra answered
For a memory of 8 K, we need 13 address lines and 8 data lines.

Explanation:

- 8 K means 8 kilobytes. 1 kilobyte = 1024 bytes. Therefore, 8 K = 8 * 1024 = 8192 bytes.
- To address each byte in the memory, we need a unique address. The number of unique addresses that can be generated with n address lines is 2^n. Therefore, we need 2^13 = 8192 unique addresses to address each byte in the memory.
- Hence, we need 13 address lines to generate these 8192 unique addresses.
- To read or write data from/to the memory, we need a data bus consisting of data lines. Since the memory has a capacity of 8192 bytes, we need 8 data lines to transfer 8 bits of data at a time (1 byte).

Which of the following is the antonym of the word SILENCE?
  • a)
    Attune
  • b)
    Babble 
  • c)
    Achromatic
  • d)
    Aurora
Correct answer is option 'B'. Can you explain this answer?

Ameya Goyal answered
Antonym of Silence: Babble

Explanation:

Silence is the absence of sound or noise. It refers to a state of quietness or stillness. In order to find the antonym of silence, we need to look for a word that represents the opposite meaning, which is noise or the opposite state of quietness.

Babble is the antonym of silence. It means to talk rapidly and in a way that is difficult to understand, often producing meaningless or continuous sounds.

Here is an explanation of why the other options are not the correct antonyms:

- Attune: Attune means to bring into harmony or alignment. It does not represent the opposite meaning of silence. In fact, one can be silent and still be attuned to their surroundings or emotions.

- Achromatic: Achromatic refers to something that is colorless or lacks hue. It is not related to sound or noise, and therefore, it is not the antonym of silence.

- Aurora: Aurora refers to a natural light display in the Earth's sky, predominantly seen in polar regions. It has no direct relationship with sound or noise, and thus, it is not the antonym of silence.

Therefore, the correct antonym of silence is babble, as it represents the opposite meaning of quietness and stillness by indicating continuous and meaningless sounds.

From the given four options choose the correct sentence:
  • a)
    I got up at 5 am every day.
  • b)
    James goes to the market yesterday.
  • c)
    She was going to the party.
  • d)
    We will seen him after two days.
Correct answer is option 'C'. Can you explain this answer?

Sudhir Patel answered
The correct answer is: 'She was going to the party.'
'I got up at 5 am every day' is incorrect.
The given sentence is a habitual action.
Habitual actions are always in the Present Tense.
'James goes to the market yesterday' is incorrect.
The given sentence is in the past tense which is evident with the use of the word 'yesterday'.
Structure:
Subject + Past tense + Object
Therefore, the verb 'went' would be used.
'She was going to the party' is the correct answer.
The given sentence is in the past continuous tense and the structure for a sentence in the past continuous tense is:
Subject + was/were +V1+ ing + Object.
'We will seen him after two days' is the incorrect answer.
The given sentence is in the simple future tense and the structure for a sentence in the simple future tense is:
Subject + will/shall +V1 form of the verb + Object.
Hence, the correct option is (C).

The different bus arbitration techniques are daisy chaining, polling and independent requesting. The bus grant and bus request lines are only assumed as control lines. For n requesting devices, the number of control lines for daisy chaining, polling and independent requesting are respectively;
  • a)
    2, n, 2n
  • b)
    2, log2(n), n
  • c)
    2, log2(n)+1, 2n
  • d)
    3, log2(n)+1, 2n
Correct answer is option 'C'. Can you explain this answer?

Saumya Saha answered
For daisy chaining, there is a single bus request line and bus grant line which is passed through each of the devices. In polling, there is log2(n) bit polling number for the sequence maintaining I/O devices. Bus is granted using a poll count. Thus log2(n) lines needed to maintain poll count. Bus request line is single. So total no of control lines = log2(n)+1. For independent requesting separate bus request and bus grant line for each I/o device. Thus 2n control lines needed.

Consider the three problems :
  • Equivalence
  • Ambiguity
  • Regularity
  • a)
    Regular and context free grammars are closed in all three problems 
  • b)
    Regular grammar is closed in equivalence and regularity but not in Ambiguity 
  • c)
    Regular grammar is closed in all three but CFL is not closed in anyone 
  • d)
    Regular and CFL grammar is closed in equivalence and regularity but not in Ambiguity 
Correct answer is option 'C'. Can you explain this answer?

For regular language
1) Equivalence: it can be checked by developed product automate for XOR function.
if XOR = O ⇒ equal else not.
2) Ambiguity: Ambiguity is decidable for regular languages & grammar since they are deterministic in nature.
3) Regularity: it is the trivial problem.
For context free language
⇒ it is not closed in any of those problems.

Consider the following values, using the IEEE 754 single-precision floating-point format. What is the equivalent value as a decimal number?
01011100101001000100000000000000
    Correct answer is '3.69'. Can you explain this answer?

    Eesha Bhat answered
    Given,
    The IEEE 754 single-precision floating-point format:
    01011100101001000100000000000000
    Now, by converting it into decimal number we get,
    Sign =0
    Exponent =10111001=185
    Fraction =01001000100000000000000
    = (−1)0(1+0.010010001)2185127
    = (1+2−2+2−5+2−9) ×258
    = 3.6986×1017
    = 3.69
    So, the equivalent value as a decimal number is 3.69.
    Hence, the correct answer is 3.69.

    Assume the level of the root node in a tree is 0. We have a tree with nodes having values as 1,3,7,15,29. Then the maximum value of level number possible is _______.
      Correct answer is '4'. Can you explain this answer?

      Priyanka Ahuja answered
      Explanation:

      To find the maximum value of the level number in the given tree, we need to analyze the pattern of the values and their corresponding levels.

      Given Tree:

      ```
      1 (Level 0)
      / \
      3 7 (Level 1)
      / \ / \
      15 29 (Level 2)
      ```

      Analysis:

      From the given tree, we can observe the following patterns:

      - The root node has a value of 1 and is at level 0.
      - The left child of the root node has a value of 3 and is at level 1.
      - The right child of the root node has a value of 7 and is also at level 1.
      - The left child of the left child of the root node has a value of 15 and is at level 2.
      - The right child of the left child of the root node has a value of 29 and is also at level 2.

      Pattern:

      Looking at the values and their corresponding levels, we can observe the following pattern:

      - The value at each level is the sum of the values at the previous level multiplied by 2, plus 1.
      - For example, the value at level 1 is (1 + 1) * 2 + 1 = 3.
      - Similarly, the value at level 2 is (3 + 7) * 2 + 1 = 15.

      Finding the Maximum Level:

      To find the maximum level number possible, we need to continue this pattern until we reach a level where the value exceeds the maximum value given in the question, which is 29.

      - For level 3, the value would be (15 + 29) * 2 + 1 = 91, which exceeds 29.
      - Therefore, the maximum level number possible is 2, which is the level of the highest value in the given tree.

      Conclusion:

      The maximum value of the level number possible in the given tree is 2, not 4 as stated in the question.

      Which of the following is/are restriction(s) in classless addressing?
      • a)
        The number of addresses needs to be a power of 2.
      • b)
        The mask needs to be included in the address to define the block.
      • c)
        The starting address must be divisible by the number of addresses in the block.
      • d)
        None of these
      Correct answer is option 'A,B,C'. Can you explain this answer?

      Avantika Menon answered
      Restrictions in Classless Addressing


      Classless addressing is a method of allocating IP addresses that allows for more flexibility and efficient use of address space compared to traditional classful addressing. However, there are certain restrictions that need to be followed when using classless addressing.


      a) The number of addresses needs to be a power of 2

      In classless addressing, IP addresses are divided into smaller blocks called subnets. Each subnet is identified by a subnet mask, which determines the number of bits used to represent the network portion of the address. The remaining bits are used to represent the host portion.

      One restriction in classless addressing is that the number of addresses in a subnet needs to be a power of 2. This is because the subnet mask is a binary value, and the number of bits used to represent the host portion must be a power of 2. For example, if a subnet has 8 addresses, it would require 3 bits to represent the host portion (2^3 = 8).


      b) The mask needs to be included in the address to define the block

      Another restriction in classless addressing is that the subnet mask needs to be included in the address to define the block. In classful addressing, the network portion of the address is determined by the class of the address (A, B, or C). However, in classless addressing, the network portion can vary depending on the subnet mask.

      By including the subnet mask in the address, it is possible to determine the network portion and the host portion of the address. This allows for more efficient routing and allocation of IP addresses.


      c) The starting address must be divisible by the number of addresses in the block

      In classless addressing, the starting address of a subnet must be divisible by the number of addresses in the block. This ensures that the addresses within the block are contiguous and do not overlap with other subnets.

      For example, if a subnet has 16 addresses, the starting address must be divisible by 16. This guarantees that the addresses from the starting address to the starting address + 15 are assigned to the subnet.


      In conclusion, the restrictions in classless addressing include the number of addresses needing to be a power of 2, the inclusion of the subnet mask in the address to define the block, and the starting address being divisible by the number of addresses in the block. These restrictions help to ensure efficient allocation and routing of IP addresses in classless addressing.

      Let G be a complete undirected graph of 6 vertices. If vertices of G are labelled, then the number of distinct cycles of length 4 in G is equal to (Give your answer up to 2 digit whole numbers)
        Correct answer is '45'. Can you explain this answer?

        Arindam Goyal answered
        Explanation:

        Complete Undirected Graph:
        - A complete undirected graph of 6 vertices has all possible edges between the vertices.
        - In this case, there are a total of 6 vertices, and each vertex is connected to every other vertex.

        Distinct Cycles of Length 4:
        - To find the number of distinct cycles of length 4 in a complete undirected graph of 6 vertices, we can use the formula:
        - Number of distinct cycles of length 4 = nC4 * (4-1)! / 2
        - Where n is the total number of vertices in the graph (in this case, n=6)

        Calculation:
        - Substituting n=6 in the formula:
        - Number of distinct cycles of length 4 = 6C4 * 3! / 2
        - 6C4 = 6! / (4! * (6-4)!) = 15
        - 3! = 6
        - Number of distinct cycles of length 4 = 15 * 6 / 2 = 45
        Therefore, the number of distinct cycles of length 4 in a complete undirected graph of 6 vertices is 45.

        An item that is read as input can be either pushed to a stack and later popped and printed, or printed directly. Which of the following will be the output if the input is the sequence of items - 1, 2, 3, 4, 5?
        • a)
          5, 4, 3, 1, 2
        • b)
          1, 5, 2, 3, 4
        • c)
          5, 4, 3, 2, 1  
        • d)
          3, 4, 5, 1, 2
        Correct answer is option 'C'. Can you explain this answer?

        Mahi Chavan answered
        Solution:

        The given sequence of items is 1, 2, 3, 4, 5.

        We can implement the given problem using a stack data structure. We can push the items onto the stack until we encounter the number 3. After encountering 3, we can pop the items from the stack and print them. Finally, we can print the remaining 2 items in the sequence.

        Let's see the step-by-step procedure to solve this problem:

        1. Initialize an empty stack.

        2. Read the input sequence of items.

        3. Push each item onto the stack until we encounter the number 3.

        4. After encountering 3, pop the items from the stack and print them until the stack becomes empty.

        5. Print the remaining 2 items in the sequence.

        Let's apply the above steps to the given input sequence:

        1. Initialize an empty stack.

        2. Read the input sequence of items: 1, 2, 3, 4, 5.

        3. Push each item onto the stack until we encounter the number 3: Stack = {1, 2}.

        4. After encountering 3, pop the items from the stack and print them until the stack becomes empty: Stack = {}, Output = {2, 1}.

        5. Print the remaining 2 items in the sequence: Output = {2, 1, 4, 5}.

        Therefore, the output sequence is 5, 4, 3, 2, 1, which is option 'C'.

        Hence, the correct answer is option 'C'.

        Consider a computer system with DMA support. The DMA module is transferring one 8-bit character in one CPU cycle from a device to memory through cycle stealing at regular intervals. Consider a 2 MHz processor. If 0.5% processor cycles are used for DMA, the data transfer rate of the device is bits per second.
          Correct answer is '80000'. Can you explain this answer?

          Gauri Banerjee answered
          Processor Cycle and DMA

          Processor Cycle:
          A processor cycle refers to the time it takes for a processor to complete one instruction. It is typically measured in terms of frequency, such as megahertz (MHz) or gigahertz (GHz). For example, a 2 MHz processor completes 2 million cycles per second.

          DMA (Direct Memory Access):
          DMA is a technique used in computer systems to enable devices to transfer data directly to and from memory without involving the CPU. This allows for faster and more efficient data transfer, as the CPU is not required to be actively involved in the process.

          Data Transfer Rate Calculation:
          To calculate the data transfer rate of a device, we need to consider the processor cycle and the percentage of cycles used for DMA.

          Given:
          - Processor frequency: 2 MHz
          - Percentage of cycles used for DMA: 0.5%

          Step 1: Calculate the number of cycles used for DMA per second.
          - Total cycles per second = Processor frequency
          - Cycles used for DMA per second = Total cycles per second * Percentage of cycles used for DMA
          - Cycles used for DMA per second = 2,000,000 * 0.005

          Step 2: Calculate the number of characters transferred per second.
          - Each cycle transfers one 8-bit character.
          - Characters transferred per second = Cycles used for DMA per second

          Step 3: Convert characters to bits.
          - 1 character = 8 bits
          - Bits transferred per second = Characters transferred per second * 8

          Step 4: Calculate the data transfer rate in bits per second.
          - Data transfer rate = Bits transferred per second

          Calculation:
          - Cycles used for DMA per second = 2,000,000 * 0.005 = 10,000 cycles per second
          - Characters transferred per second = Cycles used for DMA per second = 10,000 characters per second
          - Bits transferred per second = Characters transferred per second * 8 = 10,000 * 8 = 80,000 bits per second

          Therefore, the data transfer rate of the device is 80,000 bits per second.

          Find the average access time experienced by the CPU in a system with two levels of caches if the following information is given:
          h1 is the hit rate in the primary cache.
          his the hit rate in the secondary cache.
          cis the time to access information in the primary cache.
          cis the time to access information in the secondary cache.
          M is the time to access information in the main memory.
          • a)
            h1c1 + h2c2 + (1 + h1h2) M
          • b)
            h1c1 - h2c2 + (1 - h1h2) M
          • c)
            h1c1 + (1 - h2) h1c2 + (1 - h1) (1 - h2) M
          • d)
            h1c1 + (1 - h1) h2c2 + (1 - h1) (1 - h2) M
          Correct answer is option 'D'. Can you explain this answer?

          Sudhir Patel answered
          The secondary cache can be considerably slower, but it should be much larger to ensure a high hit rate. If the speed is less critical, it only affects the miss penalty of the primary cache. A workstation computer may include a primary cache with the capacity of tens of kilobytes and a secondary cache of several kilobytes and several megabytes.
          tavg = h1c1 + (1 - h1) h2c2 + (1 - h1)(1 - h2) M
          The number of misses in the secondary cache is given by the term (1 - h1) (1 - h2) .

          Find the output of the following program.
          main()
          {
          int i =_1_abc(10);
          print f ("%d\n",--i);
          }
          int_1_abc(int i)
          {
          return(i ++);
          }
          • a)
            1
          • b)
            5
          • c)
            9
          • d)
            11
          Correct answer is option 'C'. Can you explain this answer?

          Milan Chavan answered
          The function is returning i++ which is post incremental, so first the value of i which is 10 will be returned and then it will be incremented. so the value of i in the main function will be 10 and printing --i will print 9.

          The primary role of the physical layer in transmitting data on the network is to
          • a)
            create the signals that represent the bits in each frame onto the media
          • b)
            provide physical addressing to the devices
          • c)
            determine the path that packets take through the network
          • d)
            control data access to the media
          Correct answer is option 'A'. Can you explain this answer?

          Tanishq Yadav answered
          The role of the physical layer in transmitting data on the network can be explained as follows:

          Creating Signals
          The primary function of the physical layer is to create the signals that represent the bits in each frame onto the media. This layer is responsible for converting the digital data into analog signals that can be transmitted over the physical medium such as copper wires, fiber optic cables, or wireless signals. The physical layer takes the digital bits from the upper layers and converts them into a series of electrical or optical signals that can be transmitted over the network.

          Encoding and Decoding
          The physical layer also provides encoding and decoding mechanisms that are used to ensure that the data is transmitted accurately over the network. For example, the physical layer can use Manchester encoding, which is a technique that uses transitions in the signal to indicate the start and end of a bit. The receiving device can then decode the signal to determine the bits that were transmitted.

          Media Access
          The physical layer also controls media access, which refers to the process of granting devices access to the physical medium. This layer defines the rules that devices must follow when transmitting data over the network. For example, it can define the order in which devices can transmit data or the amount of time each device has to wait before transmitting.

          Physical Addressing
          Although the physical layer does not provide logical addressing, it does provide physical addressing to the devices. Each device on the network has a unique physical address, which is used to identify the device on the network. This physical address is also known as the MAC address.

          Conclusion
          In conclusion, the physical layer is responsible for creating signals that represent the bits in each frame onto the media, providing encoding and decoding mechanisms, controlling media access, and providing physical addressing to the devices.

          A machine sorts 200 names in a time period of 200 sec. The machine uses bubble sorting. The number of names which the machine can sort in 800 sec is (Answer to the nearest integer)
            Correct answer is '400'. Can you explain this answer?

            Ujwal Nambiar answered
            Explanation:

            The machine can sort 200 names in 200 seconds using bubble sorting.

            Therefore, the machine can sort 1 name in 1 second using bubble sorting.

            To find out how many names the machine can sort in 800 seconds, we can use the following formula:

            Number of names = (Time period * Number of names sorted in 1 second)

            Number of names = (800 * 1)

            Number of names = 800

            Therefore, the machine can sort 800 names in 800 seconds using bubble sorting.

            However, the answer needs to be rounded off to the nearest integer, which is 400.

            Conclusion:

            Hence, the machine can sort 400 names in 800 seconds using bubble sorting.

            Host A is sending data to host B over a full duplex link. A and B are using the sliding window protocol for flow control. The sender and receiver window sizes are 5 packets each. Data packets (sent only from A to B) are all 1000 bytes long and the transmission time for such a packet is 50 μs.
            Acknowledgement packets (sent only from B to A) are very small and require negligible transmission time. The propagation delay over the link is 200 μs. Calculate the maximum achievable throughput.
            • a)
              15.00 x 106 bps
            • b)
              12.33 x 106 bps
            • c)
              11.11 x 106 bps
            • d)
              7.96 x 106 bps
            Correct answer is option 'C'. Can you explain this answer?

            Shubham Das answered
            Milliseconds. The link has a propagation delay of 10 milliseconds. Host A sends the first five packets to Host B and starts its timer. Host B receives the first five packets and sends an acknowledgement (ACK) back to Host A. The ACK reaches Host A after a propagation delay. Host A receives the ACK and stops its timer. How much time does it take for Host A to send the next five packets to Host B?

            To answer this question, let's break down the time taken for each step:

            1. Host A sends the first five packets to Host B:
            - Each packet takes 50 milliseconds to transmit.
            - Total transmission time for 5 packets = 5 * 50 milliseconds = 250 milliseconds.

            2. Host B receives the first five packets and sends an ACK back to Host A:
            - The ACK packet takes 50 milliseconds to transmit.
            - The propagation delay is 10 milliseconds.
            - Total transmission time for the ACK = 50 milliseconds + 10 milliseconds = 60 milliseconds.

            3. The ACK reaches Host A after a propagation delay:
            - The propagation delay is 10 milliseconds.

            4. Host A receives the ACK and stops its timer:
            - No significant time is taken for this step.

            Now, let's calculate the total time taken for Host A to send the next five packets:

            - After Host A receives the ACK, it knows that the first five packets have been successfully received by Host B. Since the window size is 5 packets, Host A can now send the next five packets without waiting for any additional ACKs.

            - The transmission time for each packet is 50 milliseconds, and the total number of packets to be sent is 5.

            - Therefore, the total transmission time for the next five packets = 5 * 50 milliseconds = 250 milliseconds.

            Thus, it takes 250 milliseconds for Host A to send the next five packets to Host B.

            A system has n = 13 resources R0,…,R12, and k processes P0,…Pk−1. The implementation of the resource request logic of each process Pi is as follows:
            if (i%2 == 0)
            {
            if (i < n) request Ri
            if (i+2 < n) request Ri+2
            }
            else
            {
            if(i < n) request Rn - i
            if (i+2 < n) request Rn-i-2
            }
            Minimum number of the process so deadlock is possible _________.
              Correct answer is '7'. Can you explain this answer?

              Sudhir Patel answered
              As we know,
              n should be odd then deadlock will be possible if k should be = (n+2)/2.
              Now,
              n =13 then k will be floor (13+2)/2 = floor 15/2 = 7
              (n is taken as 13 because as mentioned in the question Resources are R0 to R12)
              So, n = 13 and k = 7 then deadlock is possible.
              Case I:
              Even processes request even resources and odd processes request odd resources. i.e.
              Even Processes:
              P0 requests R0 and R2
              P2 requests R2 and R4 and so on.
              Odd Processes:
              P1 requests R9 and R11
              P3 requests R7 and R9 and so on.
              So, there would not be any scenario of deadlock.
              Case II:
              All process request even resources:
              Even Processes:
              P0 requests R0 and R2
              P2 requests R2 and R4
              P4 requests R4 and R6
              P6 requests R6 and R8 (Deadlock arise)
              Odd Processes:
              P1 requests R12 and R10
              P3 requests R10 and R8
              P5 requests R8 and R6 (Deadlock arise)
              Hence, the correct answer is 7.

              A bolt is manufactured by 3 machines A, B and C. Machine A turns out twice as many items as B and machines B and C produce an equal number of items. 2% of bolts produced by A and B are defective and 4% of bolts produced by C are defective. All bolts put into 1 stockpile and 1 is chosen from this pile. What is the probability that it is defective?
              • a)
                0.075
              • b)
                0.025
              • c)
                0.15
              • d)
                0.20
              Correct answer is option 'B'. Can you explain this answer?

              Dipika Chavan answered
              To solve this problem, let's break it down step by step:

              1. Determine the production ratios:
              - Machine A produces twice as many items as Machine B.
              - Machines B and C produce an equal number of items.

              2. Calculate the percentage of defective bolts produced by each machine:
              - Machine A and B: 2% defect rate.
              - Machine C: 4% defect rate.

              3. Calculate the overall probability of selecting a defective bolt:
              - Since all bolts are put into one stockpile, we need to consider the proportion of bolts produced by each machine.
              - Let's assume that Machine B produces 1 unit. Then Machine A produces 2 units and Machine C also produces 1 unit.
              - So the total production ratio is 1 (Machine B) : 2 (Machine A) : 1 (Machine C).

              4. Calculate the total number of defective bolts:
              - Since the defect rate for Machine A and B is 2%, and the proportion of their production is 2:1, we can calculate the number of defective bolts produced by A and B.
              - For every 3 bolts produced by A and B, 2% are defective. So the number of defective bolts produced by A and B is (2/3) * 2% = 4/3%.
              - The defect rate for Machine C is 4%, so the number of defective bolts produced by C is 4%.
              - Summing up the defective bolts produced by A, B, and C, we get a total of (4/3)% + 4% = 16/3%.

              5. Calculate the probability of choosing a defective bolt:
              - The probability of choosing a defective bolt is equal to the total number of defective bolts divided by the total number of bolts in the stockpile.
              - Since the defective bolts account for 16/3% of the total production, the probability of choosing a defective bolt is (16/3) / 100 = 16/300 = 0.0533.

              6. Choose the closest option:
              - The options provided are:
              a) 0.075
              b) 0.025
              c) 0.15
              d) 0.20
              - The closest option to the calculated probability of 0.0533 is option b) 0.025.

              Therefore, the correct answer is option b) 0.025, which represents the probability of choosing a defective bolt from the stockpile.

              There are x number of identical balls which are to be placed in y number of distinct buckets. If x>= ky (where k is a natural number greater than equal to 1), then in how many ways can you place the balls in the bucket with the condition that each bucket should contain at least k balls?
              • a)
                (x-k) C (y-1)
              • b)
                (x-1) C (y-k)
              • c)
                (x-ky+y-1) C (y-1)
              • d)
                (x-ky+y+k-2) C (y-k)
              Correct answer is option 'C'. Can you explain this answer?

              Tanishq Ahuja answered
              As there have to be at least k balls in each bag, so firstly put k balls in each bag i.e k*y balls. Balls remaining: x-ky
              We can now apply balls and sticks method.
              y bags= y variables, they need to equal to x-k*y, no restrictions on how many balls in each bag. We can make a equation out of this:
              a1 + a2 + ... + ay = x- k*y
              On solving it we get our answer:  (x-ky+y-1) C (y-1)

              Chinnaswamy is driving to pick up his son from school on a Saturday which is a half day. On his way to school, he crossed a church which is 1/5th of the way to school at 9:50 hours and exactly 10 minutes later, he went past a temple which is 1/3rd of the way to school. The time after 10:00 hours at which he reaches his son’s school is ____ minutes.
              • a)
                25
              • b)
                35
              • c)
                50
              • d)
                55
              Correct answer is option 'C'. Can you explain this answer?

              Akash Rane answered
              Since we are given time to cross a point which is 1/5th of the way and 1/3rd of the way, we can rewrite them as 3/15th and 5/15th of the way which implies that 2/15th of the way was covered in 10 minutes.
              This means that the entire route was covered in 10 × 15/2 = 75 minutes (each 1/15th part is covered in 75/15 = 5 minutes) leading to time of arrival at school as 9:50 – 15 + 75 = 10: 50 hours.

              Consider host A sends a UDP datagram containing 16060 bytes of user data to host B over an Ethernet LAN. Ethernet MTU is 1500 byte. Size of the IP header is 40 byte and the size of the UDP header is 8 bytes. Which of the following is/are true about the number of fragments transmitted and contents of the offset field in the last fragment?
              • a)
                Number of fragments transmitted = 11
              • b)
                Offset field in the last fragment  = 2002
              • c)
                Number of fragments transmitted = 12
              • d)
                Offset field in the last fragment = 1820
              Correct answer is option 'B,C'. Can you explain this answer?

              Sudhir Patel answered
              Data =16068 bytes
              MTU =1500 bytes
              Data + header =1500
              ⇒ Data =1500 − 40
              ∴ Data = 1460 bytes
              Number of fragments = 16068/1460 = 12
              Since initial fragment offset is not given assume it to be 0.
              1460 in not divisible by remove 4 byte and add to last fragment
              Fragment offset of 2nd  fragment,
              =1456/8
              = 182
              Fragment offset of 3rd  fragment,
               
              = 364
              Fragment offset of 4th  fragment,
               
              = 546
              Fragment offset of 12th  fragment,
              = 2002
              As we know,
              Since there are 12 fragments,
              Fragment offset of 12th  fragment,
              = 2002
              Hence, the correct options are (B) and (C).

              Directions: Choose the sentence that best combines the given sentences.
              The airport is called the Glynco Jetport. The airline reservations and travel systems refer to the location as Brunswick, Georgia.
              • a)
                Where the airport is called the Glynco Jetport, the airline reservations and travel systems refer to the location as Brunswick, Georgia.
              • b)
                The airport is called the Glynco Jetport, the airline reservations and travel systems refer to the location as Brunswick, Georgia.
              • c)
                Even though the airline reservations and travel systems refer to the location as Brunswick, Georgia, the airport is called the Glynco Jetport.
              • d)
                When the airport is called the Glynco Jetport, the airline reservations refer to the location as Brunswick, Georgia, and the travel systems.
              Correct answer is option 'C'. Can you explain this answer?

              Amar Majumdar answered
              Answer:


              The sentence that best combines the given sentences is option C: Even though the airline reservations and travel systems refer to the location as Brunswick, Georgia, the airport is called the Glynco Jetport.

              Explanation:


              To choose the sentence that best combines the given sentences, we need to analyze the information provided in both sentences and determine the most appropriate way to connect them.

              Key Points:
              - The airport is called the Glynco Jetport.
              - The airline reservations and travel systems refer to the location as Brunswick, Georgia.

              Option A: Where the airport is called the Glynco Jetport, the airline reservations and travel systems refer to the location as Brunswick, Georgia.
              - This sentence does not provide a clear connection between the two pieces of information. The word "where" is not necessary in this context.

              Option B: The airport is called the Glynco Jetport, the airline reservations and travel systems refer to the location as Brunswick, Georgia.
              - This sentence lacks a conjunction or transition word to connect the two pieces of information.

              Option C: Even though the airline reservations and travel systems refer to the location as Brunswick, Georgia, the airport is called the Glynco Jetport.
              - This sentence effectively combines the two pieces of information by using the conjunction "even though" to indicate a contrast between the name used by the reservations and travel systems and the actual name of the airport.

              Option D: When the airport is called the Glynco Jetport, the airline reservations refer to the location as Brunswick, Georgia, and the travel systems.
              - This sentence is grammatically incorrect and incomplete. It does not provide a clear connection between the two pieces of information.

              Therefore, option C is the correct answer as it effectively combines the given sentences and maintains the intended meaning.

              ______ is a buffer that holds output for a device that cannot accept interleaved data streams.
              • a)
                Banner
              • b)
                Spool 
              • c)
                Cache
              • d)
                None of the above
              Correct answer is option 'B'. Can you explain this answer?

              Asha Das answered
              Spool

              Spool stands for Simultaneous Peripheral Operations On-Line. It is a buffer that holds output for a device that cannot accept interleaved data streams. In other words, it is a temporary storage area that allows data to be processed at a different speed than the input/output devices.

              How does spooling work?

              When a computer system sends data to a printer or other output device, it is typically done in a sequential manner. The data is sent in the order it was received, and the output device processes it one piece at a time. This can lead to inefficiencies and delays if the output device is slower than the speed at which the data is being generated.

              Spooling solves this problem by using a buffer to hold the output data. Instead of sending the data directly to the output device, it is first stored in the spool, which acts as an intermediary between the computer system and the output device. The data is then sent to the output device at a rate that it can handle, allowing for more efficient processing.

              Advantages of spooling:
              - Increased efficiency: Spooling allows the computer system to continue generating data without having to wait for the output device to process it. This improves overall system efficiency and reduces delays.
              - Interleaved processing: Spooling allows for interleaved processing of data streams. Multiple data streams can be stored in the spool and processed simultaneously, even if the output device can only handle one stream at a time.
              - Error recovery: Spooling provides a level of error recovery. If there is a problem with the output device, the data can be re-sent from the spool instead of having to be generated again.
              - Print queue management: Spooling allows for the management of print queues. Multiple print jobs can be stored in the spool and processed in the order they were received, ensuring fairness and efficient use of the output device.

              In summary, spooling is a technique used to improve the efficiency of computer systems by buffering output data for devices that cannot accept interleaved data streams. It provides advantages such as increased efficiency, interleaved processing, error recovery, and print queue management.

              Consider two systems S and R connected by routers serially, Let R0, R1, R2, R3,…R6 be the intermediate routers connected serially between S and R where R0 is connected with S and R1 and R6 is connected with R and R5. If data is transferred from S to R with the time to live at S as (00010011)2 then what is the time to live at R in binary number system? Note: Ignore leading 0′s in the answer?
              • a)
                1011
              • b)
                1012
              • c)
                1001
              • d)
                1031
              Correct answer is option 'A'. Can you explain this answer?

              Prerna Joshi answered
              And R4 be the routers in the network. The system S is connected to R0, R0 is connected to R1, R1 is connected to R2, R2 is connected to R3, and R3 is connected to R4.

              To send a packet from S to R4, the packet will pass through each router in the network, starting from R0, then R1, R2, R3, and finally reaching R4.

              The process of sending the packet from S to R4 involves several steps:

              1. S sends the packet to R0: The packet is generated by S and sent to R0 through a physical link or a network connection.

              2. R0 receives the packet: R0 receives the packet from S and processes it. It checks the destination address of the packet to determine the next hop.

              3. R0 forwards the packet to R1: R0 forwards the packet to R1 based on the routing table, which contains information about the network topology and the next hop for each destination address. R1 is the next hop for R0 to reach R4.

              4. R1 receives the packet: R1 receives the packet from R0 and processes it. It checks the destination address to determine the next hop.

              5. R1 forwards the packet to R2: R1 forwards the packet to R2 based on its routing table. R2 is the next hop for R1 to reach R4.

              6. R2 receives the packet: R2 receives the packet from R1 and processes it. It checks the destination address to determine the next hop.

              7. R2 forwards the packet to R3: R2 forwards the packet to R3 based on its routing table. R3 is the next hop for R2 to reach R4.

              8. R3 receives the packet: R3 receives the packet from R2 and processes it. It checks the destination address to determine the next hop.

              9. R3 forwards the packet to R4: R3 forwards the packet to R4 based on its routing table. R4 is the final destination for the packet.

              10. R4 receives the packet: R4 receives the packet from R3 and processes it. It checks the destination address and delivers the packet to the destination system.

              In summary, the packet travels from S to R4 through each router in the network, with each router forwarding the packet to the next hop based on its routing table.

              An instruction is read from the memory having the value stored in the program counter as 716. The number contained in the address part of the instruction is 36. What will be the effective address in relative address mode given the value pointed by index register is 12:
              • a)
                48
              • b)
                728
              • c)
                752
              • d)
                753
              Correct answer is option 'D'. Can you explain this answer?

              Given Information:
              - The value stored in the program counter is 716.
              - The number contained in the address part of the instruction is 36.
              - The value pointed by the index register is 12.

              To Find:
              The effective address in relative address mode.

              Solution:
              To find the effective address in relative address mode, we need to add the number contained in the address part of the instruction to the value stored in the program counter.

              1. Add the value stored in the program counter (716) to the number contained in the address part of the instruction (36):
              716 + 36 = 752

              2. Now, we need to consider the value pointed by the index register (12) and add it to the result obtained in step 1:
              752 + 12 = 764

              Answer:
              The effective address in relative address mode is 764.

              Which of the following choices given in the options is/are not shared by all the threads in a process?
              • a)
                Registers
              • b)
                Message Queue
              • c)
                Stack
              • d)
                Address space
              Correct answer is option 'A,C'. Can you explain this answer?

              Registers:
              Registers are small, high-speed memory locations within the CPU that store data that is being actively used by the CPU. Each thread in a process has its own set of registers. These registers include the program counter, stack pointer, and general-purpose registers. Therefore, registers are shared by all the threads in a process.

              Program Counter:
              The program counter is a register that holds the memory address of the next instruction to be executed. Each thread in a process has its own program counter, which keeps track of the execution flow for that particular thread. Therefore, the program counter is shared by all the threads in a process.

              Stack:
              The stack is a region of memory used for storing local variables, function call information, and other temporary data. Each thread in a process has its own stack, which is used for storing the local variables and function call information specific to that thread. Therefore, the stack is not shared by all the threads in a process.

              Address Space:
              The address space is the virtual memory space provided to a process. It includes the code, data, and stack segments of the process. Each thread in a process shares the same address space, which means that they can access the same code, data, and stack segments. Therefore, the address space is shared by all the threads in a process.

              Summary:
              - Registers are shared by all the threads in a process.
              - The program counter is shared by all the threads in a process.
              - The stack is not shared by all the threads in a process.
              - The address space is shared by all the threads in a process.

              Therefore, the correct answer is option 'A,C' as registers and stack are not shared by all the threads in a process.

              Which of the following sorting algorithms has the lowest worst-case complexity?
              • a)
                Merge sort
              • b)
                Bubble sort
              • c)
                Quick sort
              • d)
                Selection sort
              Correct answer is option 'A'. Can you explain this answer?

              Kunal Sen answered
              Merge Sort

              Merge sort is an efficient, stable, and comparison-based sorting algorithm that divides the unsorted list into smaller sublists, sorts those sublists, and then merges them to obtain a sorted list. It has a worst-case complexity of O(n log n).

              Bubble Sort

              Bubble sort is a simple and inefficient sorting algorithm that repeatedly steps through the list, compares adjacent elements, and swaps them if they are in the wrong order. It has a worst-case complexity of O(n^2).

              Quick Sort

              Quick sort is an efficient, comparison-based sorting algorithm that uses a divide-and-conquer strategy. It selects a pivot element and partitions the other elements into two sub-arrays, according to whether they are less than or greater than the pivot. It then recursively sorts the sub-arrays. Quick sort has a worst-case complexity of O(n^2), but on average it has a complexity of O(n log n).

              Selection Sort

              Selection sort is a simple and inefficient sorting algorithm that repeatedly finds the minimum element from the unsorted part of the list and puts it at the beginning. It has a worst-case complexity of O(n^2).

              Comparison of Worst-Case Complexities:

              - Merge sort: O(n log n)
              - Bubble sort: O(n^2)
              - Quick sort: O(n^2)
              - Selection sort: O(n^2)

              Conclusion:

              Among the given sorting algorithms, Merge sort has the lowest worst-case complexity of O(n log n). This means that it performs better than the other algorithms when dealing with larger input sizes. Merge sort's divide-and-conquer approach ensures that it consistently achieves this efficiency, regardless of the initial order of the elements. On the other hand, bubble sort, quick sort, and selection sort all have worst-case complexities of O(n^2), making them less efficient for large-scale sorting tasks.

              Consider the given 8 bit explicit normalized mantissa used for a floating data representation:
              a
              1
              a
              2
              a
              3
              a
              4
              a
              5
              a
              6
              a
              7
              a
              8
              The difference value (in decimals) between maximum and minimum mantissa is __________ [Round off to 5 decimal places].
              • a)
                0.49609
              • b)
                0.49670
              • c)
                0.49608
              • d)
                0.49619
              Correct answer is option 'A'. Can you explain this answer?

              Priyanka Ahuja answered
              To find the difference value between the maximum and minimum mantissa, we need to understand the range of values that can be represented by an 8-bit explicit normalized mantissa.

              An 8-bit explicit normalized mantissa means that the mantissa has 8 bits and is explicitly normalized, which implies that the most significant bit (MSB) is always 1. The remaining 7 bits can take on any combination of 0s and 1s.

              The maximum mantissa value can be obtained when all the bits in the mantissa are set to 1. In this case, the value of the mantissa can be calculated as follows:

              max_value = 1 + 1/2 + 1/4 + 1/8 + 1/16 + 1/32 + 1/64 + 1/128 = 1.99609375

              The minimum mantissa value can be obtained when all the bits in the mantissa, except the MSB, are set to 0. In this case, the value of the mantissa can be calculated as follows:

              min_value = 1 + 0/2 + 0/4 + 0/8 + 0/16 + 0/32 + 0/64 + 0/128 = 1.0

              To find the difference value, we subtract the minimum mantissa value from the maximum mantissa value:

              difference = max_value - min_value = 1.99609375 - 1.0 = 0.99609375

              Rounding off to 5 decimal places, the difference value is 0.99609.

              However, in the given options, none of them exactly match this value. The closest option is option 'A', which is 0.49609. It seems that there might be a typographical error in the options provided, and the correct answer should be 0.49609, not 0.99609.

              Consider the regular language L = (111 + 11111). The minimum number of states in any DFA accepting this languages is:
                Correct answer is '9'. Can you explain this answer?

                Arnab Kapoor answered
                A regular language is a language that can be expressed using a regular expression or can be recognized by a finite automaton.

                In the given language L, the regular expression can be written as (111 11111).

                This regular expression represents a language that consists of a sequence of three "1"s followed by a sequence of five "1"s.

                For example, the strings "11111111" and "1111111111" are in the language L, but the strings "1111" and "111111" are not in the language L.

                A finite automaton can also be constructed to recognize the language L. The automaton will have two states, one for the initial three "1"s and another for the following five "1"s.

                In summary, the regular language L = (111 11111) consists of strings that start with three "1"s followed by five "1"s.

                Which one of the following array represents a binary max-heap?
                • a)
                   [26, 13, 17, 14, 11, 9, 15]
                • b)
                   [26, 15, 14, 17, 11, 9, 13]
                • c)
                   [26, 15, 17, 14, 11, 9, 13]
                • d)
                   [26, 15, 13, 14, 11, 9, 17]
                Correct answer is option 'C'. Can you explain this answer?

                Arka Dasgupta answered
                Explanation:

                A binary max-heap is a complete binary tree where each node is greater than or equal to its child nodes. To determine whether an array represents a binary max-heap, we need to analyze the elements of the array.

                Array: [26, 13, 17, 14, 11, 9, 15]

                To verify if this array represents a binary max-heap, we need to check if each element is greater than or equal to its child nodes.

                Step 1: Analyzing the root node (index 0)
                The root node is 26. Its left child is 13 and its right child is 17. Both child nodes are smaller than the root node, so the first condition is satisfied.

                Step 2: Analyzing the left subtree
                The left child of the root node is 13. Its left child is 14 and its right child is 11. Both child nodes are smaller than the parent node, so the condition is satisfied.

                Step 3: Analyzing the right subtree
                The right child of the root node is 17. Its left child is 9 and its right child is 15. Both child nodes are smaller than the parent node, so the condition is satisfied.

                Conclusion:
                All the nodes in the array satisfy the condition of a binary max-heap, where each node is greater than or equal to its child nodes. Therefore, option 'C' [26, 15, 17, 14, 11, 9, 13] represents a binary max-heap.

                Direction: Study the following pie chart carefully & answer the question given below it.
                The pie chart given below shows the break-up of the cost of construction of a house (in degrees). Assuming that the total cost of construction is Rs. 60000, answer the question given below.
                The amount spent on labour exceeds the amount spent on steel by:
                • a)
                  5% of the total cost
                • b)
                  10% of the total cost
                • c)
                  12% of the total cost
                • d)
                  15% of the total cost
                Correct answer is option 'B'. Can you explain this answer?

                Given,
                Total cost = Rs. 60000
                Amount spent on labour 
                = 90/360 × 60000 = Rs. 15000
                Amount spent on steel 
                = 54/360 × 60000 = Rs. 9000
                Difference = 15000 − 9000 = Rs. 6000
                Let the amount spent on labour exceeds the amount spent on steel by x% of the total cost.
                Then,
                ⇒ x × 600 = 6000
                 ⇒ x = 6000/600
                x = 10
                The amount spent on labour exceeds the amount spent on steel by 10% of the total cost.

                Direction: Read the data carefully and answer the following question.
                The pie chart shows the percentage of total employees working in-5 companiesA,B,C,D and E. The total number of employees is 25000.
                Find the average number of employees working in companies B,C and E:
                • a)
                  19,000
                • b)
                  4,750
                • c)
                  4,450
                • d)
                  5,000
                Correct answer is option 'B'. Can you explain this answer?

                Sudhir Patel answered
                Average = 
                Number of employees in company B = 
                =5,000
                Number of employees in company C = 
                =3,750
                Number of employees in company E = 
                =5,500
                Now, Average number of employees in B,C and E.
                =4,750
                ∴ Average number of employees in B,C and E is 4,750.
                Hence, the correct option is (B).

                Chapter doubts & questions for Syllabus & Full Mock Tests - GATE Computer Science Engineering(CSE) 2025 Mock Test Series 2024 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) 2024 Exam. Find important definitions, questions, notes, meanings, examples, exercises, MCQs and online tests here.

                Chapter doubts & questions of Syllabus & Full Mock Tests - GATE Computer Science Engineering(CSE) 2025 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)

                Signup to see your scores go up within 7 days!

                Study with 1000+ FREE Docs, Videos & Tests
                10M+ students study on EduRev