Networking In C Sharp — Part 2 MCQs with Explanations
Practice high-yield Programming & Software Development MCQs on Networking In C Sharp — Part 2 with worked academic solutions for FPSC, PPSC, NTS, NITB, PTS.
Questions
38
Difficulty Level
Exam-Level
Target Exams
FPSC, PPSC, NTS...
Estimated Time
46 mins
Exam-Level FPSC PPSC NTS NITB PTS
Verified for Commission Syllabus • Oct 14, 2026
38
Verified Practice Questions
Interactive test mode with detailed academic worked solutions
Live Progress|0/38 answered
✓0 correct
✗0 wrong
0% score
🎉 Set complete! All 38 questions answered.
Question 1 of 38
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the purpose of the System.Net.WebSockets.ClientWebSocket class in C#?
Correct Answer: Option C — To provide WebSocket client functionality
Detailed Academic Explanation:
To provide WebSocket client functionality is the correct answer to “What is the purpose of the System.Net.WebSockets.ClientWebSocket class in C#”. This question is standard in competitive examination syllabi for Networking In C Sharp.
💡Key Conceptual Anchor:Networking In C Sharp
Question 2 of 38
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which method is used to close a network stream in C#?
Correct Answer: Option B — Close()
Detailed Academic Explanation:
Close() is the correct answer to “Which method is used to close a network stream in C#”. This question is standard in competitive examination syllabi for Networking In C Sharp.
💡Key Conceptual Anchor:Networking In C Sharp
Question 3 of 38
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the purpose of the System.Net.WebSockets.WebSocketServer class in C#?
Correct Answer: Option C — To implement a WebSocket server
Detailed Academic Explanation:
To implement a WebSocket server is the correct answer to “What is the purpose of the System.Net.WebSockets.WebSocketServer class in C#”. This question is standard in competitive examination syllabi for Networking In C Sharp.
💡Key Conceptual Anchor:Networking In C Sharp
Question 4 of 38
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which class in C# is used for representing a URI (Uniform Resource Identifier)?
Correct Answer: Option D — System.Uri
Detailed Academic Explanation:
System.Uri is the correct answer to “Which class in C# is used for representing a URI (Uniform Resource Identifier)”. This question is standard in competitive examination syllabi for Networking In C Sharp.
💡Key Conceptual Anchor:Networking In C Sharp
Question 5 of 38
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these is a standard for communicating multimedia content over email?
Correct Answer: Option C — Mime
Detailed Academic Explanation:
Mime is the correct answer to “Which of these is a standard for communicating multimedia content over email”. This question is standard in competitive examination syllabi for Networking In C Sharp.
💡Key Conceptual Anchor:Networking In C Sharp
Question 6 of 38
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Select the properties related to the network errors generated by WebException:
Correct Answer: Option A — response
Detailed Academic Explanation:
response is the correct answer to “Select the properties related to the network errors generated by WebException:”. This question is standard in competitive examination syllabi for Networking In C Sharp.
💡Key Conceptual Anchor:Networking In C Sharp
Question 7 of 38
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these data members of HttpResponse class is used to store the response from a http server?
Correct Answer: Option D — statusCode
Detailed Academic Explanation:
statusCode is the correct answer to “Which of these data members of HttpResponse class is used to store the response from a http server”. This question is standard in competitive examination syllabi for Networking In C Sharp.
💡Key Conceptual Anchor:Networking In C Sharp
Question 8 of 38
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following are the interfaces defined by the namespace System.Net?
Correct Answer: Option A — IAuthenticationModule
Detailed Academic Explanation:
IAuthenticationModule is the correct answer to “Which of the following are the interfaces defined by the namespace System.Net”. This question is standard in competitive examination syllabi for Networking In C Sharp.
💡Key Conceptual Anchor:Networking In C Sharp
Question 9 of 38
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following are the protocols defined by .NET runtime?
Correct Answer: Option D — All of the mentioned
Detailed Academic Explanation:
All of the mentioned is the correct answer to “Which of the following are the protocols defined by .NET runtime”. This question is standard in competitive examination syllabi for Networking In C Sharp.
💡Key Conceptual Anchor:Networking In C Sharp
Question 10 of 38
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these classes is used for operating on the request from the client to the server?
Correct Answer: Option D — httpd
Detailed Academic Explanation:
httpd is the correct answer to “Which of these classes is used for operating on the request from the client to the server”. This question is standard in competitive examination syllabi for Networking In C Sharp.
💡Key Conceptual Anchor:Networking In C Sharp
Question 11 of 38
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Choose the exceptions generated by the GetResponseStream() method defined by WebRequest.
Correct Answer: Option D — All of the mentioned
Detailed Academic Explanation:
All of the mentioned is the correct answer to “Choose the exceptions generated by the GetResponseStream() method defined by WebRequest.”. This question is standard in competitive examination syllabi for Networking In C Sharp.
💡Key Conceptual Anchor:Networking In C Sharp
Question 12 of 38
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What does the following method specify? public static WebRequest Create(string requestUriString)
Correct Answer: Option D — All of the mentioned
Detailed Academic Explanation:
All of the mentioned is the correct answer to “What does the following method specify? public static WebRequest Create(string requestUriString)”. This question is standard in competitive examination syllabi for Networking In C Sharp.
💡Key Conceptual Anchor:Networking In C Sharp
Question 13 of 38
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following is the full form of DNS?
Correct Answer: Option D — Domain Name Service
Detailed Academic Explanation:
Domain Name Service is the correct answer to “Which of the following is the full form of DNS”. This question is standard in competitive examination syllabi for Networking In C Sharp.
💡Key Conceptual Anchor:Networking In C Sharp
Question 14 of 38
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following class/classes supports the task of uploading and downloading the file?
Correct Answer: Option C — WebClient
Detailed Academic Explanation:
WebClient is the correct answer to “Which of the following class/classes supports the task of uploading and downloading the file”. This question is standard in competitive examination syllabi for Networking In C Sharp.
💡Key Conceptual Anchor:Networking In C Sharp
Question 15 of 38
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following are the classes that support the standard HTTP protocol?
Correct Answer: Option A — HttpWebRequest
Detailed Academic Explanation:
HttpWebRequest is the correct answer to “Which of the following are the classes that support the standard HTTP protocol”. This question is standard in competitive examination syllabi for Networking In C Sharp.
💡Key Conceptual Anchor:Networking In C Sharp
Question 16 of 38
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these methods gives the full URL of an URL object?
Correct Answer: Option C — AbsoluteUri
Detailed Academic Explanation:
AbsoluteUri is the correct answer to “Which of these methods gives the full URL of an URL object”. This question is standard in competitive examination syllabi for Networking In C Sharp.
💡Key Conceptual Anchor:Networking In C Sharp
Question 17 of 38
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What does the following C# code block define? class Gen<T> { T ob; }
Correct Answer: Option D — Both Generics class declaration & Declaration of variable
Detailed Academic Explanation:
Both Generics class declaration & Declaration of variable is the correct answer to “What does the following C# code block define? class Gen<T> { T ob; }”. This question is standard in competitive examination syllabi for Networking In C Sharp.
💡Key Conceptual Anchor:Networking In C Sharp
Question 18 of 38
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these is an correct way of defining generic method?
Correct Answer: Option B — public name { /* ... */ }
Detailed Academic Explanation:
public name { /* ... */ } is the correct answer to “Which of these is an correct way of defining generic method”. This question is standard in competitive examination syllabi for Networking In C Sharp.
💡Key Conceptual Anchor:Networking In C Sharp
Question 19 of 38
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C# code? class Program { static void Main(string[] args) { int ch; HttpWebRequest req = (HttpWebRequest) WebRequest.Create("http://www.example.com"); HttpWebResponse resp = (HttpWebResponse) req.GetResponse(); Stream istrm = resp.GetResponseStream(); for (int i = 1 ; ;i++) { ch = istrm.ReadByte(); if (ch == -1) break; Console.Write((char)ch); if ((i % 400) == 0) { Console.Write("\nPress Enter."); Console.ReadLine(); } } resp.Close(); } }
Correct Answer: Option D — text/html
Detailed Academic Explanation:
text/html is the correct answer to “What will be the output of the following C# code? class Program { static void Main(string[] args) { int ch; HttpWebRequest req = (HttpWebRequest) WebRequest.Create("http://www.example.com"); HttpWebResponse resp = (HttpWebResponse) req.GetResponse(); Stream istrm = resp.GetResponseStream(); for (int i = 1 ; ;i++) { ch = istrm.ReadByte(); if (ch == -1) break; Console.Write((char)ch); if ((i % 400) == 0) { Console.Write("\nPress Enter."); Console.ReadLine(); } } resp.Close(); } }”. This question is standard in competitive examination syllabi for Networking In C Sharp.
💡Key Conceptual Anchor:Networking In C Sharp
Question 20 of 38
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Why are generics used?
Correct Answer: Option C — Generics add stability to your code by making more of your bugs detectable at compile time
Detailed Academic Explanation:
Generics add stability to your code by making more of your bugs detectable at compile time is the correct answer to “Why are generics used”. This question is standard in competitive examination syllabi for Networking In C Sharp.
💡Key Conceptual Anchor:Networking In C Sharp
Question 21 of 38
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What exception is thrown if the user does not have a proper authorization?
Correct Answer: Option C — System.Security.SecurityException
Detailed Academic Explanation:
System.Security.SecurityException is the correct answer to “What exception is thrown if the user does not have a proper authorization”. This question is standard in competitive examination syllabi for Networking In C Sharp.
💡Key Conceptual Anchor:Networking In C Sharp
Question 22 of 38
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Select the type argument of open constructed type?
Correct Answer: Option C — Gen<>
Detailed Academic Explanation:
Gen<> is the correct answer to “Select the type argument of open constructed type”. This question is standard in competitive examination syllabi for Networking In C Sharp.
💡Key Conceptual Anchor:Networking In C Sharp
Question 23 of 38
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What does the following form define? Protocol://HostName/FilePath?Query
Correct Answer: Option D — All of the mentioned
Detailed Academic Explanation:
All of the mentioned is the correct answer to “What does the following form define? Protocol://HostName/FilePath?Query”. This question is standard in competitive examination syllabi for Networking In C Sharp.
💡Key Conceptual Anchor:Networking In C Sharp
Question 24 of 38
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Choose the exceptions generated by the GetReponse() method defined by WebRequest.
Correct Answer: Option D — All of the mentioned
Detailed Academic Explanation:
All of the mentioned is the correct answer to “Choose the exceptions generated by the GetReponse() method defined by WebRequest.”. This question is standard in competitive examination syllabi for Networking In C Sharp.
💡Key Conceptual Anchor:Networking In C Sharp
Question 25 of 38
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C# code? class Program { static void Main(string[] args) { Uri obj = new Uri("https://www.example.com"); Console.WriteLine(obj.AbsoluteUri); Console.ReadLine(); } }
Correct Answer: Option D — https://www.example.com
Detailed Academic Explanation:
https://www.example.com is the correct answer to “What will be the output of the following C# code? class Program { static void Main(string[] args) { Uri obj = new Uri("https://www.example.com"); Console.WriteLine(obj.AbsoluteUri); Console.ReadLine(); } }”. This question is standard in competitive examination syllabi for Networking In C Sharp.
💡Key Conceptual Anchor:Networking In C Sharp
Question 26 of 38
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these exceptions is thrown by the URL class's constructors?
Correct Answer: Option C — MalformedURLException
Detailed Academic Explanation:
MalformedURLException is the correct answer to “Which of these exceptions is thrown by the URL class's constructors”. This question is standard in competitive examination syllabi for Networking In C Sharp.
💡Key Conceptual Anchor:Networking In C Sharp
Question 27 of 38
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Choose the exceptions generated by the Create() method defined by WebRequest.
Correct Answer: Option D — All of the mentioned
Detailed Academic Explanation:
All of the mentioned is the correct answer to “Choose the exceptions generated by the Create() method defined by WebRequest.”. This question is standard in competitive examination syllabi for Networking In C Sharp.
💡Key Conceptual Anchor:Networking In C Sharp
Question 28 of 38
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these classes is used to create servers that listen to either local or remote client programs?
Correct Answer: Option B — ServerSockets
Detailed Academic Explanation:
ServerSockets is the correct answer to “Which of these classes is used to create servers that listen to either local or remote client programs”. This question is standard in competitive examination syllabi for Networking In C Sharp.
💡Key Conceptual Anchor:Networking In C Sharp
Question 29 of 38
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following classes is used to encapsulate IP address and DNS?
Correct Answer: Option C — InetAddress
Detailed Academic Explanation:
InetAddress is the correct answer to “Which of the following classes is used to encapsulate IP address and DNS”. This question is standard in competitive examination syllabi for Networking In C Sharp.
💡Key Conceptual Anchor:Networking In C Sharp
Question 30 of 38
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these classes is used to encapsulate IP address and DNS?
Correct Answer: Option C — InetAddress
Detailed Academic Explanation:
InetAddress is the correct answer to “Which of these classes is used to encapsulate IP address and DNS”. This question is standard in competitive examination syllabi for Networking In C Sharp.
💡Key Conceptual Anchor:Networking In C Sharp
Question 31 of 38
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What exception is thrown if the protocol supported by URI prefix is invalid?
Correct Answer: Option D — NotSupportedException
Detailed Academic Explanation:
NotSupportedException is the correct answer to “What exception is thrown if the protocol supported by URI prefix is invalid”. This question is standard in competitive examination syllabi for Networking In C Sharp.
💡Key Conceptual Anchor:Networking In C Sharp
Question 32 of 38
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What exception is thrown if the URI format is invalid?
Correct Answer: Option D — UriFormatException
Detailed Academic Explanation:
UriFormatException is the correct answer to “What exception is thrown if the URI format is invalid”. This question is standard in competitive examination syllabi for Networking In C Sharp.
💡Key Conceptual Anchor:Networking In C Sharp
Question 33 of 38
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which namespace is mostly preferred for the operation of networking in C#?
Correct Answer: Option C — System.Net.Mail
Detailed Academic Explanation:
System.Net.Mail is the correct answer to “Which namespace is mostly preferred for the operation of networking in C#”. This question is standard in competitive examination syllabi for Networking In C Sharp.
💡Key Conceptual Anchor:Networking In C Sharp
Question 34 of 38
★ FPSC
★ PPSC
★ FPSC
★ PPSC
How many bits are present in a single IP address?
Correct Answer: Option C — 32
Detailed Academic Explanation:
32 is the correct answer to “How many bits are present in a single IP address”. This question is standard in competitive examination syllabi for Networking In C Sharp.
💡Key Conceptual Anchor:Networking In C Sharp
Question 35 of 38
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What does URL stand for?
Correct Answer: Option A — Uniform Resource Locator
Detailed Academic Explanation:
Uniform Resource Locator is the correct answer to “What does URL stand for”. This question is standard in competitive examination syllabi for Networking In C Sharp.
💡Key Conceptual Anchor:Networking In C Sharp
Question 36 of 38
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these classes is used to access actual bits or content information of a URL?
Correct Answer: Option D — All of the mentioned
Detailed Academic Explanation:
All of the mentioned is the correct answer to “Which of these classes is used to access actual bits or content information of a URL”. This question is standard in competitive examination syllabi for Networking In C Sharp.
💡Key Conceptual Anchor:Networking In C Sharp
Question 37 of 38
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following are the classes defined by the namespace System.Net?
Correct Answer: Option D — All of the mentioned
Detailed Academic Explanation:
All of the mentioned is the correct answer to “Which of the following are the classes defined by the namespace System.Net”. This question is standard in competitive examination syllabi for Networking In C Sharp.
💡Key Conceptual Anchor:Networking In C Sharp
Question 38 of 38
★ FPSC
★ PPSC
★ FPSC
★ PPSC
How many ports of TCP/IP are reserved for specific protocols?
Correct Answer: Option B — 1024
Detailed Academic Explanation:
1024 is the correct answer to “How many ports of TCP/IP are reserved for specific protocols”. This question is standard in competitive examination syllabi for Networking In C Sharp.
💡Key Conceptual Anchor:Networking In C Sharp
✓Link copied to clipboard
Continue Your Practice
Advance Html — Part 1
Master the next curriculum module with 40 exam-standard MCQs.
💡Examiner's Advisory for Programming & Software Development
In competitive commission exams (FPSC, PPSC, KPPSC, SPSC, CSS, PMS), questions are frequently phrased with distractor options designed to catch rote learners. Whenever you answer an MCQ, read the Detailed Academic Explanation and Conceptual Anchor to understand why the remaining options are incorrect.