QUESTIONS) UP-TO-DATE ACTUAL EXAM
QUESTIONS AND 100% ACCURATE SOLUTIONS |
VERIFIED ANSWERS - INSTANT PDF DOWNLOAD
Candidate Name: ____________________________
Candidate ID: ______________________________
Date: _____________________________________
Examination Centre: ________________________
Instructions to Candidates:
This examination assesses foundational and applied knowledge in computer
science principles typically covered in COSC 275, including programming
logic, data structures, algorithms, and computational problem-solving.
Candidates are expected to demonstrate analytical reasoning, code
interpretation, and the ability to evaluate algorithmic efficiency. The exam
consists of approximately 60 questions, and this booklet contains the first 30
questions. You are required to select the most appropriate answer for each
question.
Time Allocation: 90 minutes. Answer all questions. Each question carries
equal marks. Read each question carefully before selecting your answer.
Calculators are permitted unless otherwise stated.
Core Domains Assessed:
• Algorithm Design and Complexity Analysis
• Data Structures (Arrays, Linked Lists, Stacks, Queues)
• Control Structures and Logic
• Object-Oriented Programming Concepts
• Recursion and Problem Solving
• Memory and Performance Considerations
,This examination is an original simulation designed for educational purposes
and is not affiliated with or endorsed by any official institution.
This assessment evaluates a candidate’s ability to apply computational
thinking to real-world problems. Emphasis is placed on interpreting code,
identifying logical errors, and selecting optimal algorithmic solutions.
Mastery of these concepts reflects readiness for advanced coursework in
computer science and software development.
Q1. A program processes a large dataset using a nested loop where the outer
loop runs n times and the inner loop runs n/2 times. What is the time
complexity? hard and difficult level
A. O(n)
B. O(n log n)
C. O(n²)
D. O(n³)
Correct Answer: C. O(n²)
Explanation: The outer loop runs n times and the inner loop runs n/2 times,
resulting in n × (n/2) = n²/2 operations, which simplifies to O(n²). Option A is
too small, B applies to divide-and-conquer, and D overestimates the complexity.
Q2. Which data structure is most efficient for implementing a LIFO system in
constant time? hard and difficult level
A. Queue
B. Stack
C. Linked List (unspecified)
D. Binary Tree
,Correct Answer: B. Stack
Explanation: A stack follows Last-In-First-Out behavior with push/pop
operations in O(1). Queues are FIFO, linked lists may vary, and binary trees
are not suited for strict LIFO operations.
Q3. What is the output of the following pseudocode?
x=5
for i = 1 to 3
x=x*i
print x
hard and difficult level
A. 15
B. 30
C. 60
D. 120
Correct Answer: B. 30
Explanation: Iterations: i=1 → x=5, i=2 → x=10, i=3 → x=30. Option C
assumes factorial-like behavior incorrectly; D is unrelated.
Q4. Which sorting algorithm has the best average-case performance? hard and
difficult level
A. Bubble Sort
B. Selection Sort
C. Merge Sort
D. Insertion Sort
, Correct Answer: C. Merge Sort
Explanation: Merge sort runs in O(n log n) consistently. Bubble and
selection are O(n²), insertion is O(n²) average.
Q5. In recursion, what is the purpose of a base case? hard and difficult level
A. Increase efficiency
B. Prevent infinite recursion
C. Optimize memory
D. Improve readability
Correct Answer: B. Prevent infinite recursion
Explanation: The base case stops recursive calls. Without it, recursion
continues indefinitely. Other options are secondary effects.
Q6. Which structure is best for breadth-first search? hard and difficult level
A. Stack
B. Queue
C. Heap
D. Array
Correct Answer: B. Queue
Explanation: BFS uses FIFO order, implemented with a queue. Stack is used
in DFS.