COSC 275 FINAL EXAM PALMER - (75 QUESTIONS)
UP-TO-DATE ACTUAL EXAM QUESTIONS AND
100% ACCURATE SOLUTIONS | VERIFIED
ANSWERS - INSTANT PDF DOWNLOAD
Candidate Name: ____________________________________________
Candidate ID: ______________________________________________
Date: ______________________________________________________
Examination Centre: ________________________________________
Time Allowed: 2 Hours
Total Questions: 75
Instructions:
• Answer all questions. Each question carries equal marks.
• Read each scenario carefully before selecting the most appropriate answer.
• No external materials or devices are permitted unless explicitly authorized.
• Ensure your answers are clearly marked.
• Manage your time effectively to complete all questions within the allotted
period.
Disclaimer:
This examination is an original simulation designed for academic preparation. It
is inspired by typical COSC 275-level computer science assessments and does
not replicate any official or proprietary examination content.
Core Competency Areas:
• Data Structures and Algorithms
• Object-Oriented Programming Concepts
• File Handling and Data Persistence
• Exception Handling and Debugging
• Software Design Principles
• Basic Database Integration
, This assessment evaluates a student's ability to apply intermediate
programming concepts, analyze algorithms, and design efficient software
solutions. Students are expected to demonstrate critical thinking, debugging
skills, and an understanding of structured and object-oriented programming
paradigms. The exam reflects real-world problem-solving scenarios
commonly encountered in software development environments.
Q1. A program uses a singly linked list to manage dynamic data. A developer
inserts nodes at the head for performance reasons. What is the time complexity
of insertion at the head? hard and difficult level
A. O(n)
B. O(log n)
C. O(1)
D. O(n²)
Correct Answer: C. O(1)
Explanation: Inserting at the head requires updating only one pointer,
making it constant time. O(n) applies to traversal, not insertion at head. O(log
n) is irrelevant, and O(n²) is incorrect for this operation.
Q2. A class implements encapsulation but exposes internal data through public
fields. What principle is violated? hard and difficult level
A. Abstraction
B. Encapsulation
C. Polymorphism
D. Inheritance
Correct Answer: B. Encapsulation
Explanation: Encapsulation requires restricting direct access to internal
,data. Public fields break this principle. Abstraction deals with hiding
complexity, polymorphism with behavior, and inheritance with hierarchy.
Q3. Which sorting algorithm performs best on nearly sorted data? hard and
difficult level
A. Bubble Sort
B. Insertion Sort
C. Merge Sort
D. Selection Sort
Correct Answer: B. Insertion Sort
Explanation: Insertion sort is efficient for nearly sorted data with O(n)
performance. Bubble and selection are less optimized, while merge sort
maintains O(n log n) regardless.
Q4. A recursive function lacks a base case. What is the likely outcome? hard
and difficult level
A. Stack overflow
B. Memory leak
C. Infinite loop without crash
D. Compilation error
Correct Answer: A. Stack overflow
Explanation: Without a base case, recursion continues indefinitely,
exhausting stack memory. Memory leaks are unrelated, infinite loops differ
structurally, and compilation is unaffected.
, Q5. In object-oriented design, what does polymorphism allow? hard and
difficult level
A. Multiple inheritance
B. Method overriding and dynamic binding
C. Data hiding
D. Static binding
Correct Answer: B. Method overriding and dynamic binding
Explanation: Polymorphism enables objects to be treated as instances of
their parent class while executing specific implementations. Other options
relate to different OOP concepts.
Q6. What is the primary advantage of using a hash table? hard and difficult
level
A. Ordered storage
B. Fast average lookup
C. Minimal memory usage
D. Sequential access
Correct Answer: B. Fast average lookup
Explanation: Hash tables provide O(1) average lookup. They are not
ordered, may use extra memory, and do not guarantee sequential access.
Q7. A stack is used in which scenario? hard and difficult level
A. Breadth-first search
B. Undo functionality
C. Queue scheduling
D. Database indexing
UP-TO-DATE ACTUAL EXAM QUESTIONS AND
100% ACCURATE SOLUTIONS | VERIFIED
ANSWERS - INSTANT PDF DOWNLOAD
Candidate Name: ____________________________________________
Candidate ID: ______________________________________________
Date: ______________________________________________________
Examination Centre: ________________________________________
Time Allowed: 2 Hours
Total Questions: 75
Instructions:
• Answer all questions. Each question carries equal marks.
• Read each scenario carefully before selecting the most appropriate answer.
• No external materials or devices are permitted unless explicitly authorized.
• Ensure your answers are clearly marked.
• Manage your time effectively to complete all questions within the allotted
period.
Disclaimer:
This examination is an original simulation designed for academic preparation. It
is inspired by typical COSC 275-level computer science assessments and does
not replicate any official or proprietary examination content.
Core Competency Areas:
• Data Structures and Algorithms
• Object-Oriented Programming Concepts
• File Handling and Data Persistence
• Exception Handling and Debugging
• Software Design Principles
• Basic Database Integration
, This assessment evaluates a student's ability to apply intermediate
programming concepts, analyze algorithms, and design efficient software
solutions. Students are expected to demonstrate critical thinking, debugging
skills, and an understanding of structured and object-oriented programming
paradigms. The exam reflects real-world problem-solving scenarios
commonly encountered in software development environments.
Q1. A program uses a singly linked list to manage dynamic data. A developer
inserts nodes at the head for performance reasons. What is the time complexity
of insertion at the head? hard and difficult level
A. O(n)
B. O(log n)
C. O(1)
D. O(n²)
Correct Answer: C. O(1)
Explanation: Inserting at the head requires updating only one pointer,
making it constant time. O(n) applies to traversal, not insertion at head. O(log
n) is irrelevant, and O(n²) is incorrect for this operation.
Q2. A class implements encapsulation but exposes internal data through public
fields. What principle is violated? hard and difficult level
A. Abstraction
B. Encapsulation
C. Polymorphism
D. Inheritance
Correct Answer: B. Encapsulation
Explanation: Encapsulation requires restricting direct access to internal
,data. Public fields break this principle. Abstraction deals with hiding
complexity, polymorphism with behavior, and inheritance with hierarchy.
Q3. Which sorting algorithm performs best on nearly sorted data? hard and
difficult level
A. Bubble Sort
B. Insertion Sort
C. Merge Sort
D. Selection Sort
Correct Answer: B. Insertion Sort
Explanation: Insertion sort is efficient for nearly sorted data with O(n)
performance. Bubble and selection are less optimized, while merge sort
maintains O(n log n) regardless.
Q4. A recursive function lacks a base case. What is the likely outcome? hard
and difficult level
A. Stack overflow
B. Memory leak
C. Infinite loop without crash
D. Compilation error
Correct Answer: A. Stack overflow
Explanation: Without a base case, recursion continues indefinitely,
exhausting stack memory. Memory leaks are unrelated, infinite loops differ
structurally, and compilation is unaffected.
, Q5. In object-oriented design, what does polymorphism allow? hard and
difficult level
A. Multiple inheritance
B. Method overriding and dynamic binding
C. Data hiding
D. Static binding
Correct Answer: B. Method overriding and dynamic binding
Explanation: Polymorphism enables objects to be treated as instances of
their parent class while executing specific implementations. Other options
relate to different OOP concepts.
Q6. What is the primary advantage of using a hash table? hard and difficult
level
A. Ordered storage
B. Fast average lookup
C. Minimal memory usage
D. Sequential access
Correct Answer: B. Fast average lookup
Explanation: Hash tables provide O(1) average lookup. They are not
ordered, may use extra memory, and do not guarantee sequential access.
Q7. A stack is used in which scenario? hard and difficult level
A. Breadth-first search
B. Undo functionality
C. Queue scheduling
D. Database indexing