100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.6 TrustPilot
logo-home
Exam (elaborations)

IT313 Intermediate Programming Midterm Exam Review 2025 (Qns & Ans)

Rating
-
Sold
-
Pages
32
Uploaded on
06-05-2025
Written in
2024/2025

IT313 Intermediate Programming Midterm Exam Review 2025 (Qns & Ans)IT313 Intermediate Programming Midterm Exam Review 2025 (Qns & Ans)IT313 Intermediate Programming Midterm Exam Review 2025 (Qns & Ans)

Institution
Module











Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Module

Document information

Uploaded on
May 6, 2025
Number of pages
32
Written in
2024/2025
Type
Exam (elaborations)
Contains
Unknown

Subjects

Content preview

IT313

Intermediate Programming

3.0 Credits

Midterm Exam Review (Qns & Ans)

2025




©2025

, Multiple Choice Questions (10 Questions)

1. Question:
In a recursive function, which property designates that the
recursive call is the final operation executed, allowing the compiler
to optimize stack usage?
- a. Head recursion
- b. Tail recursion
- c. Nested recursion
- d. Indirect recursion

ANS:
b. Tail recursion

Rationale:
Tail recursion occurs when a function’s recursive call is its last
action. Many compilers can optimize such calls (tail-call
optimization) by reusing the current function’s stack frame, thus
reducing memory overhead.

2. Question:
Which container in C++ dynamically adjusts its size and manages
memory automatically?
- a. Static array
- b. std::vector
- c. C-style array
- d. std::list

ANS:
b. std::vector

Rationale:
The `std::vector` provides dynamic memory allocation,
automatically resizing as elements are added, making it ideal for
cases where the size isn’t known at compile time.

3. Question:
©2025

, Which balanced binary tree data structure ensures that the height
difference between left and right subtrees is at most one?
- a. Binary Search Tree (BST)
- b. AVL Tree
- c. B-Tree
- d. Red-Black Tree

ANS:
b. AVL Tree

Rationale:
An AVL tree maintains a strict balance condition (height
difference ≤ 1) at every node, offering faster lookup times in the
worst case than an unbalanced BST.

4. Question:
Which design pattern decouples the construction of a complex
object from its representation, making it possible to create different
types of the same object using the same construction process?
- a. Singleton
- b. Observer
- c. Builder
- d. Decorator

ANS:
c. Builder

Rationale:
The Builder pattern separates object construction from its
representation, allowing the same construction process to create
various representations. This is particularly useful in constructing
complex objects in an organized and modular way.

5. Question:
In Java concurrency, which interface, when combined with the
ExecutorService framework, enables asynchronous computation
and retrieval of a result?
- a. Runnable
©2025

, - b. Callable
- c. FutureTask
- d. Timer

ANS:
b. Callable

Rationale:
The `Callable` interface allows tasks to return a result and throw
exceptions. When executed by an `ExecutorService`, it returns a
`Future` object representing the result of the asynchronous
computation.

6. Question:
According to the Liskov Substitution Principle, which statement
best describes the requirement for subclass objects relative to their
base class?
- a. Subclass objects can alter base class behavior arbitrarily.
- b. Subclass objects must be substitutable for base class objects
without affecting program correctness.
- c. Subclass objects must mirror the implementation details of
base class methods.
- d. Subclass objects eliminate the need for overriding methods.

ANS:
b. Subclass objects must be substitutable for base class objects
without affecting program correctness.

Rationale:
The Liskov Substitution Principle requires that objects of a
superclass be replaceable with objects of a subclass without
altering the desirable properties of the program, ensuring
consistent behavior.

7. Question:
In modern C++ programming, which type of smart pointer
provides exclusive ownership semantics for a dynamically allocated
object?
©2025

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
emiliophd Walden University
Follow You need to be logged in order to follow users or courses
Sold
177
Member since
2 year
Number of followers
46
Documents
4725
Last sold
4 days ago

Hi there! I\'m a former nursing student who loves to share my knowledge and experience with others. I have a collection of past study notes and papers for nursing and other programs that I sell at affordable prices. Whether you need help with anatomy, pharmacology, ethics, or anything else, I have something for you. My notes are clear, concise, and fun to read. They will make your learning easier and more enjoyable. Plus, you\'ll get to see some of my witty comments and jokes along the way. Trust me, you won\'t regret buying from me!

Read more Read less
3.5

19 reviews

5
6
4
5
3
4
2
0
1
4

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these revision notes.

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and smashed it. It really can be that simple.”

Alisha Student

Frequently asked questions