Computer Science-Practice-2

Prepare for Computer Science examinations with 25 fresh solved MCQs covering computer architecture, operating systems, DBMS, networking, algorithms, programming and cybersecurity. Includes correct answers and explanations.

Practice questions

  1. Which technique allows a CPU to execute multiple instruction stages simultaneously?
    • Multiprocessing
    • Pipelining
    • Paging
    • Spooling
  2. What is the primary function of Direct Memory Access (DMA)?
    • To encrypt memory contents
    • To allow devices to transfer data to or from memory with limited CPU intervention
    • To increase monitor resolution
    • To convert source code into machine code
  3. Which cache mapping technique allows a memory block to be placed in any cache line?
    • Direct mapping
    • Fully associative mapping
    • Fixed mapping
    • Sequential mapping
  4. Which RAID level uses mirroring to provide data redundancy?
    • RAID 0
    • RAID 1
    • RAID 5
    • RAID 6
  5. Which operating system mechanism is commonly used to control access to shared resources?
    • Semaphore
    • Compiler
    • Loader
    • Assembler
  6. What is thrashing in an operating system?
    • Excessive page swapping that reduces system performance
    • Permanent deletion of system files
    • Failure of the keyboard
    • Repeated execution of a compiler
  7. In a Unix-like operating system, what does an inode primarily store?
    • The actual file name only
    • File metadata and pointers to data blocks
    • User passwords in plain text
    • Network routing information
  8. Which operating system interface allows a program to request services from the kernel?
    • System call
    • Spreadsheet
    • Device monitor
    • Web browser
  9. Which normal form eliminates partial functional dependencies on a candidate key?
    • First Normal Form
    • Second Normal Form
    • Third Normal Form
    • Fourth Normal Form
  10. Which database key uniquely identifies each record in a table and does not allow NULL values?
    • Foreign Key
    • Primary Key
    • Alternate Attribute
    • Composite Index
  11. What is the main purpose of a foreign key in a relational database?
    • To encrypt database records
    • To establish a relationship between tables
    • To automatically delete every table
    • To increase processor speed
  12. Which SQL clause is used to filter grouped results after applying aggregate functions?
    • WHERE
    • ORDER BY
    • HAVING
    • DISTINCT
  13. What is a database view?
    • A virtual table based on a query
    • A physical network device
    • A database backup file
    • A programming language
  14. Which protocol is responsible for resolving an IPv4 address to a MAC address on a local network?
    • DNS
    • ARP
    • SMTP
    • FTP
  15. What is the primary purpose of a subnet mask in IPv4 networking?
    • To identify the network and host portions of an IP address
    • To encrypt transmitted data
    • To assign domain names
    • To identify the physical location of a computer
  16. Which sequence correctly represents the TCP three-way handshake?
    • ACK, SYN, FIN
    • SYN, SYN-ACK, ACK
    • FIN, ACK, SYN
    • SYN, FIN, RST
  17. Which transport-layer protocol provides connectionless communication?
    • TCP
    • UDP
    • HTTP
    • FTP
  18. Which protocol is commonly used by email clients to retrieve and synchronize messages from a mail server?
    • IMAP
    • DHCP
    • SNMP
    • ARP
  19. What is the primary function of a firewall?
    • To increase hard disk capacity
    • To monitor and control network traffic according to security rules
    • To compile application programs
    • To repair damaged processors
  20. What does a VLAN primarily accomplish in a switched network?
    • It increases the physical size of a switch
    • It creates logically separate broadcast domains
    • It replaces all IP addresses
    • It converts wired networks into wireless networks
  21. Which sorting algorithm uses the divide-and-conquer approach by repeatedly dividing an array into halves and merging sorted portions?
    • Bubble Sort
    • Selection Sort
    • Merge Sort
    • Linear Search
  22. Which graph algorithm finds shortest paths from a source vertex in a weighted graph with non-negative edge weights?
    • Dijkstra's Algorithm
    • Binary Search
    • Insertion Sort
    • Kruskal's Algorithm
  23. In programming, what is recursion?
    • A function calling itself
    • A program deleting its own source code
    • A method of encrypting files
    • A process of converting binary into decimal
  24. Which programming concept allows a program to handle runtime errors without abruptly terminating?
    • Inheritance
    • Exception Handling
    • Compilation
    • Data Sorting
  25. Which cryptographic technique uses a public key and a corresponding private key?
    • Symmetric encryption
    • Asymmetric cryptography
    • Simple substitution
    • Data compression
MM Academy Preparing your learning space…