Join WhatsApp ChannelDaily MCQs & Exam Updates

Computer Science MCQs

MCQs on Programming, Networking, Database and OS

51 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
Medium css fpsc

What is the purpose of an index in a database?

  • A Reduce security
  • B Improve query performance
  • C Store backups
  • D Encrypt records
Permalink
Correct Answer: Option B — Improve query performance
Explanation: Indexes improve retrieval speed by allowing databases to locate records efficiently.
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
Medium fpsc nts

Which SQL clause is used to filter rows before grouping?

  • A HAVING
  • B GROUP BY
  • C WHERE
  • D ORDER BY
Permalink
Correct Answer: Option C — WHERE
Explanation: The WHERE clause filters rows before grouping and aggregation are applied.
Submitted by: PaperMCQs
44
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
45
Medium fpsc nts

Which sorting algorithm repeatedly selects the smallest element and places it in the correct position?

  • A Merge Sort
  • B Quick Sort
  • C Selection Sort
  • D Heap Sort
Permalink
Correct Answer: Option C — Selection Sort
Explanation: Selection Sort repeatedly finds the minimum element from the unsorted portion and places it at the beginning. It is simple but inefficient for large datasets.
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 fpsc ppsc

Which scheduling algorithm gives each process a fixed time slice?

  • A FCFS
  • B Round Robin
  • C Shortest Job First
  • D Priority Scheduling
Permalink
Correct Answer: Option B — Round Robin
Explanation: Round Robin scheduling assigns a fixed time quantum to each process. If a process does not complete within its allotted time, it is moved to the end of the queue. This approach improves fairness and responsiveness in time-sharing systems.
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 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
50
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
51
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