50 Best Computer Network Multiple Choice Questions with Answers

Introduction to Computer Networks

A network is a group of computers that are connected to each other for the purpose of sharing resources.

Characteristics of Computer Networks

  • Resource sharing
  • High communication speed
  • Backup and storage
  • Scalability
  • Reliability
  • Software and hardware sharing
  • Security

Network Devices

Network devices include:

  • Hub
  • Switch
  • Bridge
  • Gateway
  • Modem
  • Router
  • Repeater

Types of Networks

  • PAN - Personal Area Network: mainly for personal use
  • LAN - Local Area Network: used in offices, buildings
  • MAN - Metropolitan Area Network: used within the city
  • WAN - Wide Area Network: used for countries or all around the world

Advantages of Networking:

  • Open to everyone
  • File sharing
  • Security
  • Easy to add a new device
  • Backup and storage

Disadvantages of Networking:

  • Requires network devices
  • Virus attack
  • Requires handler
  • High-speed internet
  • Server

Types of Protocols:

  • TCP/IP
  • HTTP
  • SMTP
  • POP
  • IMAP
  • UDP
  • PPP
  • FTP

OSI Model

The OSI (Open Systems Interconnection) model, developed by ISO, consists of seven layers that work collaboratively to transmit data from one network to another across the globe.

  • Application layer
  • Presentation layer
  • Session layer
  • Transport layer
  • Network layer
  • Data link layer
  • Physical layer

Computer Network MCQs

Multiple Choice Questions on Computer Networks:

Understanding the Meaning of PoP

PoP

stands for Post Office Protocol, which is a standard protocol that allows an email client to download an email from an email server. It is used to retrieve emails from an email server, which allows users to read and manage their emails without being connected to the internet.

Port Number of PoP

The correct answer is option C, which is 110. This is because port number 110 is assigned to the Post Office Protocol version 3 (POP3), which is used to retrieve email messages from an email server.


// No code to display for this question


Number of Layers in the OSI Model

The OSI model is made up of 7 layers, not 2, 4, or 9. Layered communication is a standard approach to organizing and managing network data, with each layer set to perform specific functions. Understanding the OSI model can help network engineers troubleshoot issues and implement solutions.

// Example of accessing the 7 layers of the OSI model
Layer 7: Application Layer (Examples include HTTP, FTP, SMTP)
Layer 6: Presentation Layer (Formats data for presentation to the application layer)
Layer 5: Session Layer (Manages communication sessions between devices)
Layer 4: Transport Layer (Establishes end-to-end connections and ensures data integrity)
Layer 3: Network Layer (Responsible for addressing, routing, and traffic control)
Layer 2: Data Link Layer (Provides error-free transfer of data between nodes)
Layer 1: Physical Layer (Defines the physical specifications for devices and connections)

What is OSI?

OSI stands for Open System Interconnection.

It is a conceptual framework that was developed by the International Organization for Standardization (ISO) to describe how different computer systems can communicate with each other over a network.

Identifying the Layer that Provides Service to the User

In networking, the Application layer provides services to the user. It is the topmost layer of the OSI (Open Systems Interconnection) network model and is responsible for providing high-level services to support user applications. The Application layer's main task is to interact with application processes to provide network services to users.

Other layers in the OSI model (such as the Session, Presentation, Transport, Network, and Physical layers) provide support functions to the Application layer. However, the Application layer is the layer that ultimately interacts with user applications and provides them with services such as file transfers, email, web browsing, and other network-related tasks.

Explanation:

A hub is a network device that acts as a central connection point for all devices on a network. It is used to connect multiple devices to a network and pass data between them. A hub is different from a switch or a router, as it does not perform any intelligent routing or filtering of data packets. It simply passes on any data received on one port to all other connected devices.


// Example code for using a hub to connect multiple devices to a network
public class NetworkHub {
  private List<Device> connectedDevices; // List of devices connected to the hub
  
  public NetworkHub() {
    connectedDevices = new ArrayList<>(); // Initialize list of connected devices
  }
  
  // Method to add a device to the hub
  public void addDevice(Device device) {
    connectedDevices.add(device);
  }
  
  // Method to remove a device from the hub
  public void removeDevice(Device device) {
    connectedDevices.remove(device);
  }
  
  // Method to broadcast data to all connected devices
  public void broadcastData(DataPacket dataPacket) {
    for(Device device : connectedDevices) {
      device.receiveData(dataPacket); // Send data packet to each device
    }
  }
}


What is Meant by Protocol?

In networking, a protocol refers to a standard set of rules and procedures which enable devices to connect and exchange information with each other. Some examples of protocols include SMTP, FTP, and IMAP. These protocols define how data is transmitted over a network of devices.

The use of standardized protocols ensures that devices can communicate with each other, even if they are manufactured by different companies. Without protocols, it would be impossible to create networks that allow devices to connect, share information, and perform various tasks together.

Identifying the Server for Hosting Websites

In order to host a website, a web server is primarily used. It is responsible for serving webpages to users upon request. Other servers such as mail servers and database servers do not serve websites directly.

Therefore, the correct answer is B) Web server.

HTTP Full Form

The full form of HTTP is HyperText Transfer Protocol.

HTTP is the foundation of data communication on the World Wide Web and it involves the transfer of hypertext, multimedia, and other files between web servers and clients.

Protocol for Browsing Data

The protocol primarily used for browsing data is HTTP.


// Example of sending an HTTP request in JavaScript using XMLHttpRequest
var xhr = new XMLHttpRequest();
xhr.open("GET", "https://example.com/data", true);
xhr.send();

HTTP (Hypertext Transfer Protocol) is an application-layer protocol used for transmitting data over the internet. It is the foundation of data communication on the World Wide Web and is commonly used for transferring web pages, images, videos, and other multimedia content between web servers and clients (browsers).

Identifying the Versions of IP

There are two versions of IP, which are IPV4 and IPV6.


//Example code to display the IP version
#include <stdio.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <string.h>

int main() {
    char ip_address[INET6_ADDRSTRLEN];
    struct in6_addr ipv6;

    inet_pton(AF_INET6, "::1", &ipv6);
    printf("IP address version: ");
    if (IN6_IS_ADDR_V4MAPPED(&ipv6)) {
        printf("IPV4\n");
    } else {
        printf("IPV6\n");
    }

    return 0;
}

In the given code, we are checking the IP address version using the

inet_pton()

function from

arpa/inet.h

library in C programming.

Identification of the First Network Based on TCP/IP Protocol

The first network based on TCP/IP protocol was ARPANET.

In the given options, the correct answer is (A) ARPANET.

ARPANET was the predecessor to the modern internet, and was a wide area network that was initially created by the United States Department of Defense.

The other options - HUB, Ethernet Card, and Router - are networking components that became relevant after the creation of ARPANET and the TCP/IP protocol.

Identifying the Most Common Internet Protocol

Out of the options provided, the most commonly used internet protocol is SMTP.


// Code to retrieve the most commonly used internet protocol
String mostCommonProtocol = "SMTP";

In general, SMTP (Simple Mail Transfer Protocol) is used for sending and receiving emails across the internet. It is a reliable protocol that ensures the delivery of emails to the recipient’s mailbox.

Understanding TCP/IP

TCP/IP stands for Transmission Control Protocol/Internet Protocol. It is the foundation of the internet and responsible for the delivery of data packets from one device to another.

It is a set of communication protocols that allows computers to communicate with each other over the internet. The protocol is responsible for breaking data into packets, routing those packets, and then reassembling them at the destination.

The protocol ensures that data is transmitted efficiently, predictably, and without error. It sets the rules for how data should be transmitted and received and ensures that devices on the network can communicate with each other.

Understanding TCP/IP is essential to building and supporting computer networks and applications that rely on the internet.

LET answer = "B"

// storing the answer to the given question in a variable called 'answer'

Identification of Missing Layer in TCP/IP and OSI Models

In the comparison of the TCP/IP and OSI models, it can be concluded that the session layer is absent in the TCP/IP model but present in the OSI model. The other three layers; network, transport, and application layers are present in both models.

Therefore, option (B) which states that the session layer is not included in the TCP/IP model but included in the OSI model is correct.


//No code to display for this prompt.  

What is the Collection of Hyperlinked Documents on the Internet Known as?

The collection of hyperlinked documents on the internet is known as the World Wide Web (WWW).

Understanding URL

In the context of the internet, a URL (Uniform Resource Locator) is a string of characters that identifies the location (address) of a specific resource on the web. Resources can include web pages, images, videos, documents, and so on. A URL is composed of several parts, including the protocol (such as HTTP or HTTPS), the domain name or IP address of the server hosting the resource, and the specific location of the resource on the server.

E.g. https://www.example.com/path/to/resource


Identifying Incorrect Network Topology

In networking, a topology refers to the physical or logical layout of a network. The most common types of network topologies are Bus, Star, Ring, and Mesh. The task is to identify the incorrect network topology from the given options.


Bus
Star
P2P
Ring

The correct answer is C) P2P.

P2P stands for Point-to-Point, which is not a topology but a communication protocol between two nodes. Point-to-Point connections are typically used in WAN (Wide Area Network) and VPN (Virtual Private Network) connections, where two endpoints establish a direct and secure link between them.

The other three network topologies listed above are:

  • Bus: In a Bus topology, all devices are connected to a single cable, creating a linear structure.
  • Star: In a Star topology, each device is connected to a central hub or switch, creating a spoke-and-hub structure.
  • Ring: In a Ring topology, devices are connected in a circular configuration, where each device is connected to its adjacent devices, creating a closed loop.

FTP Port Number

In networking, FTP stands for File Transfer Protocol. It is used to transfer files from one host to another over a TCP/IP-based network. The port number used by FTP for communication is 21.

IPv4 Address Length

The length of an IPv4 address is 32 bits.


// Sample code to represent IPv4 address in Java
String ipAddress = "127.0.0.1";


IPv6 Address Length

The length of an IPv6 address is 128 bits, which allows for an exponentially larger number of unique addresses than IPv4's 32-bit address length. This expansion is necessary due to the increasing number of devices connected to the internet.

// Example of an IPv6 address:
2001:0db8:85a3:0000:0000:8a2e:0370:7334


Understanding Email Communication: SMTP

In email communication, SMTP is the protocol used when a main server sends mail to another mail server. FTP is File Transfer Protocol, while TCP/IP is the underlying communication protocol of the internet. MIME is Multipurpose Internet Mail Extensions, a format for sending multimedia attachments in emails. Therefore, the correct option is B) SMTP.

SMTP Port Number

The port number for SMTP is 25.

const portNumber = 25;

SMTP (Simple Mail Transfer Protocol) is responsible for transmitting email messages between servers. Port 25 is the default and standard port number used by SMTP.

Explanation:

MIME stands for Multipurpose Internet Mail Extension. It is a standard that extends the format of email messages to support text in character sets other than ASCII, as well as attachments of audio, video, images, and application programs. MIME allows email messages to have different content types such as text, HTML, images, audio, and video.

Understanding Port Number 143

Port number 143 is used for Internet Messaging Access Protocol (IMAP), which is used for accessing email messages on a mail server. IMAP allows the user to access emails from anywhere, using various devices, with the ability to view and manipulate email messages without downloading them to the local device. Port number 143 is used for the communication between the email client and the email server using the IMAP protocol. It is important to note that IMAP and SMTP are two separate protocols, with SMTP being used for sending emails and IMAP used for accessing them.

Identifying Network Devices for Connecting Two Dissimilar Types of Networks

In networking, it's common to have different types of networks within an organization. Such networks may differ in their topology, equipment, or design. When it becomes necessary to connect two dissimilar types of networks, special network devices called gateways are used.

Gateways are network devices that act as an entry or exit point to a network. They are primarily designed to convert different communication protocols used in different networks, to ensure that communication between the two networks can take place without any issues. For instance, a gateway is used to enable communication between a local network and the internet.

Therefore, the correct answer to the question is D) Gateway.

Device Used to Boost Weak Signals

In networking, a device used to enhance a weakened signal is called a repeater. It is used to regenerate and amplify the signal to extend the reach of a transmission. A repeater enables a stronger and clearer signal to be transmitted over long distances or through obstacles that dampen signal strength.

Out of the given options, the correct answer is B) Repeater.

Media Access Control (MAC)

The acronym MAC stands for Media Access Control, which refers to the protocol that governs how devices access a shared network medium. The MAC address is a unique identifier assigned to a device's network interface controller (NIC) for use in networking communications. This address is composed of 6 pairs of digits that identify the manufacturer of the device and its unique identification number.

Understanding the principles of MAC is essential in computer networking, as it forms the foundation on which network communications operate. By controlling device access to the network, security and reliability can be increased while ensuring that multiple devices can share the same network medium effectively.


Example:
const macAddress = "00:1B:44:11:3A:B7"; //example MAC address

MAC Address Length

The length of a MAC address is 48 bits.

CODE:
python
mac_address_length = 48 # in bits

Allocating and Managing Network Resources

In networking, the primary responsibility of resource allocation and management lies with a server. The server serves as a central hub that manages and allocates resources such as memory, processing power, disk space, databases, applications, and network management tools. Other devices on the network such as nodes and clients rely on the server to provide these resources and services. Bluetooth is a wireless data transfer technology that enables devices to communicate with each other over short distances. Although it facilitates communication, it does not manage or allocate network resources. Therefore, the correct answer is B) Server.

Types of Network Topologies

In networking, the topology refers to the layout of connected devices. One such topology is the star topology where all data passes through a central computer. This configuration centralizes network management, making it easier to identify issues and troubleshoot when necessary. Therefore, the correct answer is option C - Star topology.

// Example of Star Topology in Python
class StarTopology:
    def __init__(self, central_computer, connected_devices):
        self.central_computer = central_computer
        self.connected_devices = connected_devices
    def send_data(self, data):
        for device in self.connected_devices:
            device.receive_data(data)


Device Used in Network Layer

In the Network Layer, Router is used as a device to connect two or more networks. It forwards the data packets between different computer networks based on their IP addresses.

Other devices like Switches and Repeaters operate on the Data Link layer and Application Gateway operates on the Application layer.

// Example of a basic router configuration
interface GigabitEthernet0/0/0
ip address 192.168.1.1 255.255.255.0
!
interface GigabitEthernet0/0/1
ip address 10.0.0.1 255.255.255.0
!
ip route 192.168.2.0 255.255.255.0 GigabitEthernet0/0/0
ip route 192.168.3.0 255.255.255.0 GigabitEthernet0/0/1

Code:

python
# This program checks if a given string is a palindrome or not

def is_palindrome(string):
    # convert all characters of string to lowercase to ignore case sensitivity
    string = string.lower()
    # remove all spaces from the string
    string = string.replace(" ", "")
    # compare reversed string with original string
    if string == string[::-1]:
        return True
    else:
        return False

# test cases
print(is_palindrome("racecar")) # True
print(is_palindrome("A man a plan a canal Panama")) # True
print(is_palindrome("hello world")) # False

P:

This program checks whether a given string is a palindrome or not. A string is a palindrome if it remains the same when its characters are reversed.

The `is_palindrome()` function takes a string as an input and returns True if it is a palindrome, otherwise, it returns False. The function works as follows:

- It converts all characters of the string to lowercase to ignore case sensitivity. - It removes all spaces from the string. - It compares the reversed string with the original string. If they are equal, it returns True, otherwise, False.

The program includes some test cases to verify the correctness of the `is_palindrome()` function.

Requirements for Using a Simple Network Management System

To use a Simple Network Management System, certain rules must be followed. These rules help ensure that the system runs smoothly and effectively. In addition to rules, the following components are also important:

  • Servers: A Simple Network Management System requires servers to manage and monitor network devices.
  • Protocols: The system relies on specific protocols to communicate with network devices and gather data.
  • IP: The system uses IP addresses to identify and communicate with network devices.

By following the necessary rules and having the right components in place, a Simple Network Management System can provide an efficient and reliable solution for managing and monitoring network devices.

Major Difference between SNMPv3 and SNMPv2

The significant difference between SNMPv3 and SNMPv2 is improved security. SNMPv3 has numerous security features, such as authentication, which necessitates a password to communicate with the device, and encryption, which prevents unauthorized access to the traffic flowing between devices. SNMPv2, on the other hand, lacks security features, making it easier for hackers to gain access to the device's information.

Identifying VPN as the network extending private network across public network

When it comes to extending a private network across a public one, the answer is usually VPN. VPN stands for Virtual Private Network, and it is a technology that allows you to create a secure, encrypted connection between your private network and a public network like the internet.

VPN is a popular way for businesses and individuals to protect their data and online activities from hackers, eavesdroppers, and other threats. By using VPN, you can access resources on your private network from anywhere in the world, as long as there is an internet connection.

So, the answer to the question is B) Virtual private network.

Identifying the Presentation Layer

In the OSI model, the presentation layer is responsible for data translating. It is the sixth layer and is responsible for handling data formats, encryption/decryption of data, character encoding/decoding, compression/decompression of data, etc. The primary function of this layer is to present data to the application layer in a format that is recognizable to the receiving system.


// Example code for implementing Presentation layer in Java

public class PresentationLayer {
   private ApplicationLayer appLayer;
   
   public PresentationLayer(ApplicationLayer appLayer) {
      this.appLayer = appLayer;
   }
   
   public void presentData(String data) {
      // perform data translations here
      // character encoding, decryption, etc.
      
      // pass data to application layer
      appLayer.receiveData(data);
   }
}

// usage
ApplicationLayer app = new ApplicationLayer();
PresentationLayer presentation = new PresentationLayer(app);
presentation.presentData("Data to be presented");


Identifying the Layer for Interface with User

The Application layer determines the interface of the system with the user. The other layers - Network, Data Link, and Presentation - are involved in network communication and data transfer between systems.

// Example of Application layer usage in Java
public class UserInterface {

   

// methods for creating and managing user interface elements
}


Identifying Point-to-Point Line Configuration

The correct answer is D) All of the above. All Ring, Mesh, and Star configurations can be implemented with point-to-point lines, where each node is connected directly to one or more other nodes.


// No code to optimize or provide comments as it is a simple question and answer format.


Identifying the Device that Links Two Homogeneous Packed Broadcast Local Networks

In networking, a device used to link two homogeneous packed broadcast local networks is called a bridge. A bridge is used to connect two network segments together and might be used to filter and forward traffic based on MAC addresses. It connects two networks at the data link layer of the OSI model and operates at the MAC address level. A bridge is designed to extend a single network, whereas a router is designed to separate networks.

Among the given options, the correct answer is C) Bridge.

Explanation:

When data is transmitted over a communication channel, it is vulnerable to errors. Parity bits are used to detect errors that occur during transmission. The parity bit is an extra bit added to a sequence of bits that is used to detect errors in the transmission of the data. The parity bit is set to either 0 or 1, depending on whether the number of 1-bits in the message is even or odd. If an error occurs during transmission, the parity check will detect that the number of 1-bits is no longer even or odd, indicating that an error has occurred.


// Example of parity bit generation:
// Adding parity bit at the end of the message
String message = "1010101";
int count = 0;

for(int i=0; i<message.length(); i++){
    if(message.charAt(i) == '1'){
        count++;
    }
}
if(count%2 == 0){ // Even parity
    message += '0';
} else{ // Odd parity
    message += '1';
}


Identifying the Class of an IP Address

In order to identify which class an IP address belongs to, you need to look at the value of its first octet.

The following are the ranges of values that correspond to each class of IP addresses:

  • Class A: 0.0.0.0 to 127.255.255.255
  • Class B: 128.0.0.0 to 191.255.255.255
  • Class C: 192.0.0.0 to 223.255.255.255
  • Class D: 224.0.0.0 to 239.255.255.255
  • Class E: 240.0.0.0 to 255.255.255.255

Out of the given IP addresses, 121.12.12.248 belongs to class A as its first octet value is between 0 and 127.

Code:


None (This is only a question and answer format. No code is involved.)

What is a LAN?

A LAN stands for Local Area Network.

It is a computer network that interconnects devices within a limited area such as a home, school, laboratory or office building. The main purpose of a LAN is to enable the sharing of resources and information between connected devices.

Understanding Private Key in Asymmetric Key Cryptography

In asymmetric key cryptography, the receiver of a message generates a key pair that includes a public key and a private key. The public key is distributed to anyone who wishes to send messages to the receiver, while the private key is kept secret and only known to the receiver.

The private key is used by the receiver to decrypt messages that have been encrypted using their public key. Therefore, the answer to the given question is option B - the receiver keeps the private key in asymmetric key cryptography.

Calculating the Maximum Efficiency of Pure ALOHA

In order to calculate the maximum efficiency of pure ALOHA, we need to use the following formula:

Efficiency = G * e^(-2G)

Where G represents the offered load.

In this case, the value of G is given as 0.5. So, by substituting the value of G in the formula, we get:

Efficiency = 0.5 * e^(-2 * 0.5)

Simplifying this equation, we get:

Efficiency = 0.5 * e^(-1)

Using a calculator, we get:

Efficiency = 0.5 * 0.3679
Efficiency = 0.18395

Therefore, the maximum efficiency of pure ALOHA at G = 0.5 is 18.4% (option D).

Packet Switching

In packet switching, data is divided into small packets and transmitted over a network. Each packet is sent individually and can take a different path to reach its destination. This switching method is used in modern computer networks and allows for more efficient use of network resources.

Understanding Proxy Servers

In computer networking, a proxy server is a server application or appliance that acts as an intermediary for requests from clients seeking resources from servers that provide those resources.

A proxy server can be used for various purposes, including improving security, filtering content, and improving performance. It can also be used to provide anonymity and hide the IP address of the client making a request.

A proxy server is also commonly known as an application-level gateway.

Identifying Servers that Allow LAN Users to Share Data

In a Local Area Network (LAN), servers provide different functions to LAN users. Below are different types of servers, and we need to identify which among them allows the users to share data.

Communication server


Point server


Data server


File server

The correct answer is File server. It is the type of server that stores and manages files for users in a LAN environment. Users can access the files from their computers and share them with other users on the LAN.

Correct Formula for Total Vulnerable Time in Pure ALOHA

The formula for the total vulnerable time value of pure ALOHA is 2*Tfr.

Note: In pure ALOHA, the vulnerable time is the time it takes to transmit a frame (Tfr) and since the transmission can start at any time in the slot, there are two chances of collision (at the beginning and end of the slot), hence the multiplier of 2.

Total Vulnerable Time (TVT) = 2*Tfr

Identifying a Bit-Oriented Protocol

In networking, protocols are the set of rules and guidelines that govern the data exchange over the internet. There are different types of protocols used in data communication, including character-oriented, bit-oriented, and byte-oriented protocols. One of the common bit-oriented protocols is HDLC or High-level link control, which transmits data from one network to another through binary digits or bits.

Out of the given options, SSL and HTTP are character-oriented protocols, while HDLC is a bit-oriented protocol. Hence, the correct answer is B) HDLC.

Note that being familiar with different networking protocols and their properties can help in the effective troubleshooting of network issues and optimizing the network performance.

CODE:

// No code provided as the question is theoretical.

Technical Interview Guides

Here are guides for technical interviews, categorized from introductory to advanced levels.

View All

Best MCQ

As part of their written examination, numerous tech companies necessitate candidates to complete multiple-choice questions (MCQs) assessing their technical aptitude.

View MCQ's
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.