SS2 Second Term Computer Science Past Questions And Answers
SS2 second term Computer Science questions with options and answers:
Question: What is the purpose of a database management system (DBMS)?
a) Display graphics
b) Manage and organize data
c) Create web pages
d) Compile code
Answer: b) Manage and organize data
Question: Which sorting algorithm has a worst-case time complexity of O(n log n)?
a) Bubble sort
b) Quick sort
c) Insertion sort
d) Selection sort
Answer: b) Quick sort
Question: What does DNS stand for in the context of computer networks?
a) Domain Name System
b) Data Network Server
c) Dynamic Network Security
d) Digital Naming Service
Answer: a) Domain Name System
Question: Which of the following is a key feature of object-oriented programming (OOP)?
a) Code redundancy
b) Code modularity
c) Code obfuscation
d) Code duplication
Answer: b) Code modularity
Question: What is the purpose of the “try” and “except” blocks in Python?
a) Define functions
b) Handle exceptions
c) Create loops
d) Perform mathematical operations
Answer: b) Handle exceptions
Question: Which data structure is suitable for implementing a priority queue?
a) Array
b) Linked list
c) Queue
d) Heap
Answer: d) Heap
Question: What is the role of a firewall in computer security?
a) Manage files
b) Control network access
c) Execute code
d) Design user interfaces
Answer: b) Control network access
Question: Which type of testing focuses on evaluating individual units or components of a software system?
a) Integration testing
b) System testing
c) Unit testing
d) Regression testing
Answer: c) Unit testing
Question: In object-oriented programming, what is encapsulation?
a) Hiding implementation details
b) Grouping code statements
c) Replicating code
d) Creating interfaces
Answer: a) Hiding implementation details
Question: What is the purpose of a foreign key in a relational database?
a) Identify a record uniquely
b) Establish a link between tables
c) Sort data alphabetically
d) Calculate aggregate functions
Answer: b) Establish a link between tables
Question: Which programming language is often used for mobile app development?
a) C
b) Java
c) PHP
d) Ruby
Answer: b) Java
Question: What does AJAX stand for in web development?
a) Asynchronous JavaScript and XML
b) Advanced Java and XML
c) Automated JavaScript and XML
d) Application Java and XML
Answer: a) Asynchronous JavaScript and XML
Question: Which type of error is detected during compilation?
a) Syntax error
b) Runtime error
c) Logical error
d) Linker error
Answer: a) Syntax error
Question: What is the purpose of the “else” statement in programming?
a) Loop execution
b) Exception handling
c) Conditional branching
d) File management
Answer: c) Conditional branching
Question: Which network topology is known for its fault tolerance, as data can take multiple paths?
a) Bus
b) Ring
c) Star
d) Mesh
Answer: d) Mesh
Question: What is a VPN used for in computer networks?
a) Virus protection
b) Virtual Private Network
c) Video processing
d) Visual presentation
Answer: b) Virtual Private Network
Question: Which SQL clause is used to filter the results of a query?
a) SELECT
b) WHERE
c) JOIN
d) ORDER BY
Answer: b) WHERE
Question: What is the purpose of the DRY principle in programming?
a) Don’t Repeat Yourself
b) Data Retrieval Yield
c) Dynamic Replication
d) Design Rules for Yield
Answer: a) Don’t Repeat Yourself
Question: Which data structure is often used to represent hierarchical relationships?
a) Stack
b) Queue
c) Tree
d) Graph
Answer: c) Tree
Question: What is the primary function of an application server in a client-server architecture?
a) Store data
b) Process business logic
c) Manage network connections
d) Display web pages
Answer: b) Process business logic.