• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 4 out of 114 pages
Exam (elaborations)

WGU D278 Final Exam Prep (Latest Update 2024 / 2025) Scripting and Programming - Foundations | Questions and Verified Answers | 100% Correct | Grade A

Document preview thumbnail
Preview 4 out of 114 pages

WGU D278 Final Exam Prep (Latest Update 2024 / 2025) Scripting and Programming - Foundations | Questions and Verified Answers | 100% Correct | Grade A

Content preview

WGU D278 Final Exam Prep (Latest Update 2024 /
2025) Scripting and Programming - Foundations |
Questions and Verified Answers | 100% Correct |
Grade A

Section 1: Advanced Programming Concepts
Question 1
What is the primary purpose of a design pattern in software engineering?
A. To provide a reusable solution to a common problem
B. To enforce strict coding standards
C. To replace the need for documentation
D. To guarantee bug-free code
Correct Answer: A. To provide a reusable solution to a common problem
Rationale: Design patterns are reusable solutions to commonly
occurring problems in software design. They are not strict
standards (B), do not replace documentation (C), and cannot
guarantee bug-free code (D).
Question 2
Which design pattern ensures a class has only one instance and provides
a global point of access to it?
A. Factory
B. Singleton

,C. Observer
D. Decorator
Correct Answer: B. Singleton
Rationale: The Singleton pattern restricts instantiation of a class to
one object. Factory (A) creates objects. Observer (C) handles event
notification. Decorator (D) adds responsibilities dynamically.
Question 3
Which design pattern defines a family of algorithms, encapsulates each
one, and makes them interchangeable?
A. Strategy
B. Adapter
C. Facade
D. Proxy
Correct Answer: A. Strategy
Rationale: The Strategy pattern allows algorithms to vary
independently from clients. Adapter (B) converts interfaces. Facade
(C) simplifies a subsystem. Proxy (D) controls access.
Question 4
What is the purpose of the Model-View-Controller (MVC) architectural
pattern?
A. To separate data, presentation, and logic
B. To combine data and presentation
C. To eliminate the need for a database
D. To speed up compilation

,Correct Answer: A. To separate data, presentation, and logic
Rationale: MVC separates internal representations of information
from the ways information is presented to and accepted from the
user.
Question 5
What is a race condition in concurrent programming?
A. A behavior where the output depends on the sequence or timing of
uncontrollable events
B. A condition where two threads execute in perfect sequence
C. A condition where a program runs faster than expected
D. A condition where memory is automatically freed
Correct Answer: A. A behavior where the output depends on the sequence
or timing of uncontrollable events
Rationale: Race conditions occur when multiple threads access
shared data simultaneously, and the outcome depends on timing.
Question 6
What is a deadlock?
A. A situation where two or more threads are blocked forever, waiting for
each other
B. A situation where a thread finishes execution
C. A situation where a program crashes
D. A situation where memory is leaked
Correct Answer: A. A situation where two or more threads are blocked
forever, waiting for each other

, Rationale: Deadlock occurs when processes hold resources and wait
for resources held by others.
Question 7
What is a mutex?
A. A synchronization primitive used to protect shared resources
B. A type of loop
C. A data structure for storing strings
D. A function for sorting
Correct Answer: A. A synchronization primitive used to protect shared
resources
Rationale: A mutex (mutual exclusion) ensures that only one thread
accesses a resource at a time.
Question 8
What is a semaphore?
A. A synchronization primitive that controls access to a common resource
by multiple processes
B. A type of variable
C. A sorting algorithm
D. A data structure
Correct Answer: A. A synchronization primitive that controls access to a
common resource by multiple processes
Rationale: Semaphores use counters to manage access to shared
resources.

Document information

Uploaded on
October 6, 2026
Number of pages
114
Written in
2026/2027
Type
Exam (elaborations)
Contains
Questions & answers
$47.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Sold
2
Followers
0
Items
80
Last sold
2 weeks ago



Why students choose Stuvia

Created by fellow students, verified by reviews

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

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right 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 aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions