CS 351 Exam Study Guide 2026 Questions
CS 351 — COMPUTER SCIENCE EXAM STUDY GUIDE 2026
|| 100% GUARANTEED PASS <LATEST VERSION>
Comprehensive Coverage of: Data Structures and Algorithms Object-Oriented
Programming Principles Software Engineering Methodologies Database
Management Systems Operating Systems and Process Management Computer
Networks and Internet Protocols Cybersecurity and Data Protection Artificial
Intelligence and Machine Learning Basics
CS 351 — COMPUTER SCIENCE EXAM STUDY GUIDE 2026
Instructions: Use these questions to test your knowledge. Cover the answers and
try to answer as fully as possible before checking the solution.
Data Structures and Algorithms (15 Questions)
1. What is the key difference between an array and a linked list?
A: An array provides contiguous memory locations with constant-time access by
index, but fixed size. A linked list uses non-contiguous nodes connected by
pointers, allowing dynamic size but requiring sequential access, resulting in O(n)
time for element access.
2. Describe the time complexity for searching in a balanced Binary Search Tree
(BST).
A: O(log n) for search, insertion, and deletion, as each step halves the number of
nodes to be considered.
3. What is the worst-case time complexity of Quicksort?
A: O(n²). This occurs when the pivot is consistently the smallest or largest element
,(e.g., when the array is already sorted and the first/last element is chosen as the
pivot).
4. In the context of graph theory, what is the difference between BFS and DFS?
A: Breadth-First Search (BFS) explores a graph level-by-level using a queue, ideal
for finding the shortest path. Depth-First Search (DFS) explores as far as possible
along a branch before backtracking using a stack, which is useful for cycle
detection and topological sorting.
5. What data structure would you use to implement an LRU (Least Recently
Used) cache?
A: A combination of a Hash Map (for O(1) access) and a Doubly Linked List (for
O(1) insertion and deletion of the most recently and least recently used items).
6. What does the "Big O" notation O(n log n) typically describe?
A: It describes the time complexity of efficient sorting algorithms (like Merge Sort
and Heap Sort) and is considered a "linearithmic" time complexity.
7. What is a stable sorting algorithm? Provide an example.
A: A stable sort preserves the relative order of records with equal keys. Merge
Sort is a stable algorithm, while Quicksort is typically not.
8. What is a heap? Name one key operation and its complexity.
A: A heap is a complete binary tree that satisfies the heap property (min-heap or
max-heap). Inserting an element (heapify-up) has a time complexity of O(log n).
9. Describe the Dutch National Flag algorithm.
A: It is a programming paradigm (a variant of three-way partitioning) used to sort
an array of three distinct elements (e.g., 0s, 1s, and 2s) in a single, linear pass.
10. What is the purpose of dynamic programming?
A: To solve complex problems by breaking them down into simpler, overlapping
subproblems, solving each subproblem only once, and storing their solutions
(memoization or tabulation) to avoid redundant computations.
, 11. What is the difference between a graph and a tree?
A: A tree is a connected, acyclic undirected graph. All trees are graphs, but not all
graphs are trees. A graph can have cycles and may not be connected.
12. What is an adjacency list? When is it preferred over an adjacency matrix?
A: An adjacency list is a collection of lists or arrays used to represent a graph,
where each list corresponds to a node's neighbors. It is preferred for sparse
graphs as it saves space (O(V+E)).
13. What does the Greedy Algorithm strategy entail?
A: It makes the locally optimal choice at each stage with the hope of finding a
global optimum. It's used in algorithms like Dijkstra's (for shortest path) and
Kruskal's (for Minimum Spanning Tree), but does not always yield the best
solution.
14. What is an in-order traversal of a Binary Search Tree (BST)?
A: It visits the nodes in the order: left subtree, root, right subtree. This traversal
outputs the nodes in non-decreasing sorted order.
15. What is the time complexity of inserting an element into a hash table,
assuming a good hash function?
A: O(1) amortized time complexity for insertion, assuming minimal collisions.
Object-Oriented Programming Principles (15 Questions)
16. What are the four main pillars of OOP?
A: Encapsulation, Abstraction, Inheritance, and Polymorphism.
17. What is the difference between overloading and overriding?
A: Overloading occurs when two or more methods in the same class have the
same name but different parameters (compile-time polymorphism). Overriding
occurs when a subclass provides a specific implementation for a method already
defined in its superclass (runtime polymorphism).
18. What is an abstract class? Can you instantiate it?
A: An abstract class is a class that cannot be instantiated and may contain abstract
CS 351 — COMPUTER SCIENCE EXAM STUDY GUIDE 2026
|| 100% GUARANTEED PASS <LATEST VERSION>
Comprehensive Coverage of: Data Structures and Algorithms Object-Oriented
Programming Principles Software Engineering Methodologies Database
Management Systems Operating Systems and Process Management Computer
Networks and Internet Protocols Cybersecurity and Data Protection Artificial
Intelligence and Machine Learning Basics
CS 351 — COMPUTER SCIENCE EXAM STUDY GUIDE 2026
Instructions: Use these questions to test your knowledge. Cover the answers and
try to answer as fully as possible before checking the solution.
Data Structures and Algorithms (15 Questions)
1. What is the key difference between an array and a linked list?
A: An array provides contiguous memory locations with constant-time access by
index, but fixed size. A linked list uses non-contiguous nodes connected by
pointers, allowing dynamic size but requiring sequential access, resulting in O(n)
time for element access.
2. Describe the time complexity for searching in a balanced Binary Search Tree
(BST).
A: O(log n) for search, insertion, and deletion, as each step halves the number of
nodes to be considered.
3. What is the worst-case time complexity of Quicksort?
A: O(n²). This occurs when the pivot is consistently the smallest or largest element
,(e.g., when the array is already sorted and the first/last element is chosen as the
pivot).
4. In the context of graph theory, what is the difference between BFS and DFS?
A: Breadth-First Search (BFS) explores a graph level-by-level using a queue, ideal
for finding the shortest path. Depth-First Search (DFS) explores as far as possible
along a branch before backtracking using a stack, which is useful for cycle
detection and topological sorting.
5. What data structure would you use to implement an LRU (Least Recently
Used) cache?
A: A combination of a Hash Map (for O(1) access) and a Doubly Linked List (for
O(1) insertion and deletion of the most recently and least recently used items).
6. What does the "Big O" notation O(n log n) typically describe?
A: It describes the time complexity of efficient sorting algorithms (like Merge Sort
and Heap Sort) and is considered a "linearithmic" time complexity.
7. What is a stable sorting algorithm? Provide an example.
A: A stable sort preserves the relative order of records with equal keys. Merge
Sort is a stable algorithm, while Quicksort is typically not.
8. What is a heap? Name one key operation and its complexity.
A: A heap is a complete binary tree that satisfies the heap property (min-heap or
max-heap). Inserting an element (heapify-up) has a time complexity of O(log n).
9. Describe the Dutch National Flag algorithm.
A: It is a programming paradigm (a variant of three-way partitioning) used to sort
an array of three distinct elements (e.g., 0s, 1s, and 2s) in a single, linear pass.
10. What is the purpose of dynamic programming?
A: To solve complex problems by breaking them down into simpler, overlapping
subproblems, solving each subproblem only once, and storing their solutions
(memoization or tabulation) to avoid redundant computations.
, 11. What is the difference between a graph and a tree?
A: A tree is a connected, acyclic undirected graph. All trees are graphs, but not all
graphs are trees. A graph can have cycles and may not be connected.
12. What is an adjacency list? When is it preferred over an adjacency matrix?
A: An adjacency list is a collection of lists or arrays used to represent a graph,
where each list corresponds to a node's neighbors. It is preferred for sparse
graphs as it saves space (O(V+E)).
13. What does the Greedy Algorithm strategy entail?
A: It makes the locally optimal choice at each stage with the hope of finding a
global optimum. It's used in algorithms like Dijkstra's (for shortest path) and
Kruskal's (for Minimum Spanning Tree), but does not always yield the best
solution.
14. What is an in-order traversal of a Binary Search Tree (BST)?
A: It visits the nodes in the order: left subtree, root, right subtree. This traversal
outputs the nodes in non-decreasing sorted order.
15. What is the time complexity of inserting an element into a hash table,
assuming a good hash function?
A: O(1) amortized time complexity for insertion, assuming minimal collisions.
Object-Oriented Programming Principles (15 Questions)
16. What are the four main pillars of OOP?
A: Encapsulation, Abstraction, Inheritance, and Polymorphism.
17. What is the difference between overloading and overriding?
A: Overloading occurs when two or more methods in the same class have the
same name but different parameters (compile-time polymorphism). Overriding
occurs when a subclass provides a specific implementation for a method already
defined in its superclass (runtime polymorphism).
18. What is an abstract class? Can you instantiate it?
A: An abstract class is a class that cannot be instantiated and may contain abstract