Join WhatsApp ChannelDaily MCQs & Exam Updates

Computer Science MCQs

MCQs on Programming, Networking, Database and OS

53 Questions
Subject Preparation Guide

Prepare Computer Science with confidence

Strengthen your knowledge of computer fundamentals, hardware, software, programming, networks, databases and information technology.

Computer BasicsProgrammingNetworksDatabases
Recommended for academic classes, IT tests and computer portions of competitive examinations.
Computer Science preparation illustration
41
Hard css pms

Which topology provides the highest fault tolerance?

  • A Bus
  • B Star
  • C Ring
  • D Mesh
Permalink
Correct Answer: Option D — Mesh
Explanation: Mesh topology offers multiple communication paths between nodes, providing excellent redundancy and fault tolerance.
Submitted by: PaperMCQs
42
Medium css fpsc

Which memory is fastest among the following?

  • A Hard Disk
  • B RAM
  • C Cache Memory
  • D ROM
Permalink
Correct Answer: Option C — Cache Memory
Explanation: Cache memory stores frequently used data close to the CPU and is significantly faster than RAM.
Submitted by: PaperMCQs
43
Hard css fpsc

Which algorithm is commonly used to find the shortest path in a weighted graph?

  • A Bubble Sort
  • B Dijkstra's Algorithm
  • C Binary Search
  • D Depth First Search
Permalink
Correct Answer: Option B — Dijkstra's Algorithm
Explanation: Dijkstra's Algorithm finds shortest paths in weighted graphs with non-negative edge weights and is widely used in navigation systems.
Submitted by: PaperMCQs
44
Medium css pms

What is polymorphism in object-oriented programming?

  • A Data hiding
  • B Ability of an object to take multiple forms
  • C Memory allocation
  • D Database indexing
Permalink
Correct Answer: Option B — Ability of an object to take multiple forms
Explanation: Polymorphism allows objects to be treated through a common interface while exhibiting different behaviors depending on their actual type.
Submitted by: PaperMCQs
45
Medium css fpsc

Which OSI layer is responsible for end-to-end communication?

  • A Network Layer
  • B Data Link Layer
  • C Transport Layer
  • D Session Layer
Permalink
Correct Answer: Option C — Transport Layer
Explanation: The Transport Layer provides end-to-end communication, reliability, flow control, and error handling using protocols such as TCP and UDP.
Submitted by: PaperMCQs
46
Medium css fpsc

What is the primary purpose of normalization in relational databases?

  • A Increase redundancy
  • B Reduce redundancy
  • C Increase storage space
  • D Improve graphics rendering
Permalink
Correct Answer: Option B — Reduce redundancy
Explanation: Normalization organizes data into structured tables to minimize redundancy and dependency issues. It improves data integrity, reduces update anomalies, and makes databases easier to maintain and scale in real-world applications.
Submitted by: PaperMCQs
47
Medium css pms

Which data structure is most suitable for implementing recursion?

  • A Queue
  • B Array
  • C Stack
  • D Heap
Permalink
Correct Answer: Option C — Stack
Explanation: Recursion relies on the call stack to store function calls, local variables, and return addresses. Every recursive call creates a new stack frame, which is removed when the function returns. This makes the stack the fundamental data structure behind recursion.
Submitted by: PaperMCQs
48
Medium css fpsc

What is the purpose of a firewall?

  • A Increase processor speed
  • B Protect networks from unauthorized access
  • C Store files permanently
  • D Compress data
Permalink
Correct Answer: Option B — Protect networks from unauthorized access
Explanation: A firewall monitors and filters network traffic according to predefined security rules. It acts as a barrier between trusted and untrusted networks, helping prevent unauthorized access and cyberattacks.
Submitted by: PaperMCQs
49
Medium css pms

What is encapsulation in object-oriented programming?

  • A Combining data and methods into a single unit
  • B Creating multiple classes
  • C Executing parallel processes
  • D Allocating memory dynamically
Permalink
Correct Answer: Option A — Combining data and methods into a single unit
Explanation: Encapsulation is the process of bundling data and methods within a class while restricting direct access to internal details. It improves modularity, maintainability, and security by controlling how data is accessed and modified.
Submitted by: PaperMCQs
50
Medium css fpsc

What is the time complexity of Binary Search in the worst case?

  • A O(n)
  • B O(log n)
  • C O(n²)
  • D O(1)
Permalink
Correct Answer: Option B — O(log n)
Explanation: Binary Search repeatedly divides a sorted dataset into halves until the target value is found or determined absent. Because the search space is halved each step, the worst-case time complexity is logarithmic, O(log n).
Submitted by: PaperMCQs
51
Medium css fpsc

Which layer of the OSI model is responsible for routing packets?

  • A Transport Layer
  • B Network Layer
  • C Session Layer
  • D Presentation Layer
Permalink
Correct Answer: Option B — Network Layer
Explanation: The Network Layer is responsible for logical addressing and routing of packets between networks. Protocols such as IP operate at this layer, enabling data to travel across interconnected networks efficiently.
Submitted by: PaperMCQs
52
Medium css pms

Which data structure follows the Last In First Out (LIFO) principle?

  • A Queue
  • B Array
  • C Stack
  • D Linked List
Permalink
Correct Answer: Option C — Stack
Explanation: A stack follows the Last In First Out principle, meaning the most recently added element is removed first. Stacks are widely used in function calls, recursion, expression evaluation, and memory management.
Submitted by: PaperMCQs
53
Medium css fpsc

Which programming language is known as the "mother of all languages"?

  • A Python
  • B Java
  • C C
  • D FORTRAN
Permalink
Correct Answer: Option C — C
Explanation: C programming language is often called the "mother of all languages" because many modern programming languages like C++, Java, and Python are derived from or influenced by C.
Submitted by: PaperMCQs