Computer Networks Previous Year Questions (page 3)
173 Computer Networks (Computer Science) questions asked in DSSSB TGT / PGT previous year papers, each with the correct answer and explanation. Read them free on UTpaper, or attempt the full papers as timed online tests.
What is the advantage of using a sliding window over a stop-and-wait protocol?
ASliding window is simpler to implement.
BSliding window uses larger packet sizes.
CSliding window increases throughput by allowing multiple packets to be sent before
acknowledgment.
DSliding window requires no acknowledgments.
Show answerHide answer
Correct answer: (C) Sliding window increases throughput by allowing multiple packets to be sent before
acknowledgment.
Explanation
Stop-and-wait sends one frame and waits for its ACK. A sliding window allows several frames in flight before acknowledgment, which uses the link better and gives higher throughput.
In which scenario would the ReadConsole system call be used over ReadFile?
AWhen reading input from a network socket
BWhen reading from a database
CWhen reading from the console or terminal window
DWhen reading from a disk file
Show answerHide answer
Correct answer: (C) When reading from the console or terminal window
Explanation
In the Windows API, ReadConsole reads characters from the console input buffer (the terminal window). ReadFile is the general call for files, pipes and devices.
TCP is full-duplex: once connected, data can flow in both directions at the same time. TCP is connection-oriented and stateful, and does not broadcast.
Which of the following is NOT a field in the UDP header?
AChecksum
BSequence Number
CSource Port
DLength
Show answerHide answer
Correct answer: (B) Sequence Number
Explanation
The UDP header has only four fields: source port, destination port, length and checksum. Sequence numbers belong to TCP, which needs them for reliable, ordered delivery.
What does an ICMP Destination Unreachable message indicate?
AThe packet’s checksum is invalid.
BThe destination host or network is unreachable.
CThe packet has reached its destination.
DThe destination IP address is incorrect.
Show answerHide answer
Correct answer: (B) The destination host or network is unreachable.
Explanation
ICMP Destination Unreachable (type 3) is sent by a router or host when a packet cannot be delivered to the destination network, host, protocol or port.
Which of the following scenarios indicates successful connection establishment in TCP?
AOnly the SYN is sent and received
BData packets are transmitted without SYN packets
CSYN, SYN-ACK and ACK packets are exchanged
DOnly the SYN-ACK is sent
Show answerHide answer
Correct answer: (C) SYN, SYN-ACK and ACK packets are exchanged
Explanation
TCP sets up a connection with a three-way handshake: the client sends SYN, the server replies SYN-ACK and the client answers ACK. Only after this exchange is the connection established.
Which firewall type acts as an intermediary for requests between a client and a server?
AProxy firewall
BStateful
CPacket-filtering
DCircuit-level gateway
Show answerHide answer
Correct answer: (A) Proxy firewall
Explanation
A proxy firewall (application-level gateway) sits between client and server: it receives the client's request and makes its own request to the server, so the two never connect directly.
Which of the following protocols supports multiplexing in transport layer?
AHTTP
BFTP
CUDP
DSMTP
Show answerHide answer
Correct answer: (C) UDP
Explanation
Transport-layer protocols such as UDP and TCP multiplex several application streams over one network connection using port numbers. HTTP, FTP and SMTP are application-layer protocols.
How does TCP ensure a clean termination of both sides during a normal connection release?
ABy resending SYN packets
BBy encrypting all termination packets
CBy entering the LISTEN state after termination
DBy sending FIN and ACK packets sequentially
Show answerHide answer
Correct answer: (D) By sending FIN and ACK packets sequentially
Explanation
In a normal TCP release, each side sends a FIN and the other side acknowledges it with an ACK (usually four segments). This closes both directions of the connection cleanly.
In the switch control statement of the C program, the control falls through all the cases
unless the _______ statement is given or the end of the switch block is reached.
Acontinue
Bbreak
Cfor
Dreturn
Show answerHide answer
Correct answer: (B) break
Explanation
Without break, control falls through into the following cases until a break or the end of the switch. continue applies only to loops.
Cellular phones and televisions use the __________ regions of the electromagnetic spectrum
for signal transmission.
Aultraviolet and visible light
Bgamma rays and X-rays
Cradio waves and microwaves
Dinfrared and visible light
Show answerHide answer
Correct answer: (C) radio waves and microwaves
Explanation
Mobile phones and TV broadcasting send signals on radio waves and microwaves, the long-wavelength part of the spectrum, because these travel far and pass through the atmosphere.
The control statement in C program that allows us to make a decision from multiple number
of choices simultaneously is called _______.
Aswitch
Bwhile
Cgoto
Dfor
Show answerHide answer
Correct answer: (A) switch
Explanation
A switch statement chooses one of many case labels by the value of a single expression. Loops repeat code and goto jumps; they do not choose among several cases.
Which protocol enables presence detection, contact management, and real-time messaging
in instant messaging applications?
AIMAP (Internet Message Access Protocol)
BSIP (Session Initiation Protocol)
CXMPP (Extensible Messaging and Presence Protocol)
DIRC (Internet Relay Chat)
Show answerHide answer
Correct answer: (C) XMPP (Extensible Messaging and Presence Protocol)
Explanation
XMPP (Jabber) is an open XML-based protocol for instant messaging, presence (online status) and contact lists (rosters). IMAP is for email, and SIP sets up calls.
What is a transport layer address typically called?
ASubnet Mask
BPort Numbe
CMAC Address
DIP Address
Show answerHide answer
Correct answer: (B) Port Numbe
Explanation
The transport layer identifies a process on a host by a port number (16 bits in TCP/UDP). MAC addresses belong to the data link layer and IP addresses to the network layer.
Which of the following is NOT a phase of TCP congestion control?
ASlow start
BData fragmentation
CFast retransmit
DCongestion avoidance
Show answerHide answer
Correct answer: (B) Data fragmentation
Explanation
TCP congestion control uses slow start, congestion avoidance, fast retransmit and fast recovery. Fragmentation of data is done at the IP (network) layer, not a congestion control phase.
Which of the following correctly describes a TCP connection termination?
AIt is immediate and requires no acknowledgment.
BIt does not involve the FIN flag.
CIt uses a two-way handshake.
DIt ensures both the sender and receiver agree to close the connection.
Show answerHide answer
Correct answer: (D) It ensures both the sender and receiver agree to close the connection.
Explanation
TCP connection termination is graceful: each side sends a FIN and the other acknowledges it (a four-way exchange), so both ends agree to close. It is not immediate and does use the FIN flag.
What will be the output of the following code?
#include <stdio.h>
int main() {
int x = 5;
switch(x) {
case 5:
printf("Five");
default:
printf("Default");
}
return 0;
}
ADefault
BCompilation error
CFive
DFiveDefault
Show answerHide answer
Correct answer: (D) FiveDefault
Explanation
case 5 matches and prints "Five". There is no break, so control falls through to default and also prints "Default", giving FiveDefault.
What will be the output of the following code?
#include <stdio.h>
int main() {
int a = 2, b = 3;
switch (a) {
case 1:
printf("Case 1");
break;
case 2:
switch (b) {
case 3:
printf("Case 3");
break;
default:
printf("Inner Default");
}
default:
printf("Outer Default");
}
return 0;
}
ACase 3Inner Default
BCase 3
CInner DefaultOuter Default
DCase 3Outer Default
Show answerHide answer
Correct answer: (D) Case 3Outer Default
Explanation
a = 2 selects case 2; the inner switch matches case 3, prints "Case 3", and its break exits only the inner switch. With no break after it, control falls into the outer default and prints "Outer Default".
Which of the following describes the use of digital certificates in authentication?
AThey store the user's passwords.
BThey compress large files for secure transfer.
CThey verify the identity of entities using Public Key Infrastructure (PKI).
DThey encrypt data transmission.
Show answerHide answer
Correct answer: (C) They verify the identity of entities using Public Key Infrastructure (PKI).
Explanation
Note: the official answer key marks option 2. Conceptually, digital certificates verify the identity of an entity using PKI (option 3). The key has been kept as published.
Which technology is commonly used in Wi-Fi to enhance signal range and reliability?
AMIMO (Multiple Input Multiple Output)
BWEP (Wired Equivalent Privacy)
CTDMA (Time Division Multiple Access)
DCDMA (Code Division Multiple Access)
Show answerHide answer
Correct answer: (A) MIMO (Multiple Input Multiple Output)
Explanation
MIMO uses several antennas at the transmitter and receiver (spatial multiplexing, diversity), which raises throughput, range and reliability in 802.11n/ac/ax Wi-Fi. WEP is an old security protocol, not a range technique.
What does the TCP service model guarantee about the order of data delivery?
AData is delivered in the order it is transmitted.
BData is not guaranteed to arrive in any specific order.
CData may arrive out of order and is handled by the application layer.
DData is delivered as fast as possible.
Show answerHide answer
Correct answer: (A) Data is delivered in the order it is transmitted.
Explanation
TCP provides a reliable, in-order byte stream: sequence numbers let the receiver reorder segments, so the application gets data in the same order it was sent. UDP gives no ordering guarantee.
Which of the following is true about nested switch statements in C?
ABoth inner and outer switch statements must have a default case.
BA switch statement cannot contain another switch.
CInner switch cases should not contain break statement
DA switch statement can contain another switch statement inside any of its cases.
Show answerHide answer
Correct answer: (D) A switch statement can contain another switch statement inside any of its cases.
Explanation
C allows switch statements to be nested: any case of an outer switch can contain a complete inner switch. A default case is optional and break is allowed inside inner cases.
Which advantage of AJAX helps in reducing bandwidth consumption?
AAJAX uses less JavaScript.
BAJAX only loads images on the page.
CAJAX increases data transfer.
DAJAX sends and retrieves only small amounts of data from the server.
Show answerHide answer
Correct answer: (D) AJAX sends and retrieves only small amounts of data from the server.
Explanation
AJAX exchanges only the small pieces of data needed in the background and updates part of the page, instead of reloading the whole page, so less data is transferred.
Which of the following statements is/are true with reference to java servlets?
(i) A Servlet is a Java program that runs without a web server.
(ii) It receives the requests and responds to them using related protocols (usually HTTP).
AOnly (i)
BBoth (i) and (ii)
CNeither (i) nor (ii)
DOnly (ii)
Show answerHide answer
Correct answer: (D) Only (ii)
Explanation
Only (ii) is true: a servlet receives and answers requests, usually over HTTP. It runs inside a web server or servlet container, so (i) is false.
In connectionless services offered by the network layer, packets are injected into the network individually and routed independently of each other. In this context, the packets are frequently called ______, and the network is called a ______ network.
Adatagrams; virtual-circuit
Bdatagrams; datagram
Cvirtual circuits; datagram
Dvirtual circuits; virtual-circuit
Show answerHide answer
Correct answer: (B) datagrams; datagram
Explanation
In a connectionless network service packets are called datagrams and the network a datagram network. Connection-oriented service uses a virtual-circuit network.
Which of the following refers to messages sent from transport entity to transport entity in the transport layer of the ISO/OSI network model?
APacket
BBlock
CFrame
DSegment
Show answerHide answer
Correct answer: (D) Segment
Explanation
Messages exchanged between transport entities in the transport layer are called segments (TPDUs). Packets belong to the network layer and frames to the data link layer.
In which of the following radio channel sharing methods several users share the same frequency channel of higher bandwidth by dividing it into different time slots?
ATime Division Multiple Access
BNetwork Division Multiple Access
CFrequency Division Multiple Access
DPacket Division Multiple Access
Show answerHide answer
Correct answer: (A) Time Division Multiple Access
Explanation
TDMA lets several users share one frequency channel by giving each user its own time slot.
Which of the following with reference to digital electronics is a device that stores (and sometimes displays) the number of times a particular event or process has occurred, often in relationship to a clock signal?
ALatch
BFlip-Flop
CCounter
DRegister
Show answerHide answer
Correct answer: (C) Counter
Explanation
A counter stores, and may display, the number of times an event has occurred, usually counting clock pulses.
Which of the following belongs to the fixed and wireless configuration category of mobile devices?
AWi-Fi router
BDesktop computer
CWi-Fi Dongle
DLaptop
Show answerHide answer
Correct answer: (A) Wi-Fi router
Explanation
A Wi-Fi router is fixed in place but connects devices wirelessly, so it is a fixed and wireless device. A laptop is mobile, and a desktop is fixed and wired.
Which of the following is designed in such a way that all the stations are connected through a single cable known as a backbone cable in the computer network?
ABus topology
BMesh topology
CStar topology
DRing topology
Show answerHide answer
Correct answer: (A) Bus topology
Explanation
In a bus topology all stations connect to one common cable called the backbone.
Which of the following internet protocols provides a way for applications to send encapsulated IP datagrams without having to establish a connection?
ATelnet
BUnit Datagram Protocol
CTransmission Control Protocol
Drlogin
Show answerHide answer
Correct answer: (B) Unit Datagram Protocol
Explanation
UDP (User Datagram Protocol, shown as 'Unit Datagram Protocol') lets applications send encapsulated IP datagrams without setting up a connection. TCP is connection-oriented.
What feature of the transport layer prevents data loss?
AEncryption
BPacket switching
CAddressing
DFlow control
Show answerHide answer
Correct answer: (D) Flow control
Explanation
Transport-layer flow control (with acknowledgements and retransmission) stops a fast sender from overwhelming the receiver, which prevents data loss.
How to use these DSSSB TGT / PGT Computer Science questions
Every question here was asked in a real DSSSB TGT / PGT paper; the paper and shift are shown on the card, and the number opens the question on its own page. Try each one before tapping Show answer, then attempt the full DSSSB TGT / PGT papers as timed tests to check your speed under exam conditions.