Computer Science-Practice-1

Prepare for the SPSC Computer Science examination with 25 practice MCQs covering programming, databases, operating systems, networking, data structures, software engineering and computer fundamentals, with correct answers and explanations.

Practice questions

  1. Which CPU register holds the address of the next instruction to be executed?
    • Accumulator
    • Program Counter
    • Instruction Register
    • Memory Address Register
  2. Which data structure follows the Last In, First Out (LIFO) principle?
    • Queue
    • Linked List
    • Stack
    • Tree
  3. What is the primary function of a compiler?
    • To execute hardware instructions directly
    • To translate source code into machine or target code
    • To manage database records
    • To allocate network addresses
  4. Which logic gate produces an output of 1 when its two inputs are different?
    • AND
    • OR
    • XOR
    • NAND
  5. What is the base of the hexadecimal number system?
    • 2
    • 8
    • 10
    • 16
  6. What is the average time complexity of binary search on a sorted array?
    • O(n)
    • O(log n)
    • O(n²)
    • O(1)
  7. Which type of memory retains its contents when power is switched off?
    • RAM
    • Cache
    • ROM
    • Register
  8. Which protocol automatically assigns IP addresses to devices on a network?
    • FTP
    • DHCP
    • SMTP
    • HTTP
  9. Which SQL command removes all rows from a table while retaining the table structure?
    • DROP
    • DELETE DATABASE
    • TRUNCATE
    • ALTER
  10. Which object-oriented programming concept allows a class to acquire properties and methods from another class?
    • Encapsulation
    • Inheritance
    • Polymorphism
    • Abstraction
  11. Which CPU scheduling algorithm allocates a fixed time slice to each process?
    • First Come First Served
    • Shortest Job First
    • Round Robin
    • Priority Scheduling
  12. At which OSI layer does a standard Ethernet switch primarily operate?
    • Physical Layer
    • Data Link Layer
    • Network Layer
    • Transport Layer
  13. Which encryption method uses the same secret key for encryption and decryption?
    • Asymmetric encryption
    • Symmetric encryption
    • Hashing
    • Digital signature
  14. Which software development model is particularly associated with repeated risk analysis and iterative development?
    • Waterfall Model
    • Spiral Model
    • Big Bang Model
    • V-Model
  15. Which ACID property ensures that a database transaction is completed entirely or not at all?
    • Consistency
    • Isolation
    • Durability
    • Atomicity
  16. What is the main purpose of a device driver?
    • To compress files
    • To enable the operating system to communicate with hardware
    • To create database tables
    • To prevent all network attacks
  17. Which database system is commonly classified as a document-oriented NoSQL database?
    • MySQL
    • PostgreSQL
    • MongoDB
    • Oracle Database
  18. Which HTML element is used to create a hyperlink?
    • <escape><link></escape>
    • <escape><a></escape>
    • <escape><href></escape>
    • <escape><url></escape>
  19. Which algorithmic approach solves a problem by dividing it into smaller subproblems?
    • Divide and Conquer
    • Linear Search
    • Brute Force only
    • Randomization
  20. Which service translates domain names into IP addresses?
    • DHCP
    • DNS
    • FTP
    • SMTP
  21. Which software testing technique examines functionality without requiring knowledge of the internal code?
    • White-box testing
    • Black-box testing
    • Static code analysis
    • Code coverage testing
  22. What is the primary characteristic of narrow artificial intelligence?
    • It performs every intellectual task like a human
    • It is designed for specific tasks or limited domains
    • It has unlimited general reasoning ability
    • It operates without data or algorithms
  23. Which file system is commonly used by modern Windows installations?
    • ext4
    • NTFS
    • HFS+
    • APFS
  24. Which network topology connects devices to a central hub or switch?
    • Ring
    • Bus
    • Star
    • Mesh
  25. What does API stand for in software development?
    • Application Programming Interface
    • Advanced Processing Instruction
    • Automated Program Integration
    • Application Process Internet
MM Academy Preparing your learning space…