Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 3 out of 23 pages
Exam (elaborations)

ITSW 2113 (D278) Scripting & Programming Foundations Latest OA Guide 2025

Document preview thumbnail
Preview 3 out of 23 pages

ITSW 2113 (D278) Scripting & Programming FoundaITSW 2113 (D278) Scripting & Programming Foundations Latest OA Guide 2025ITSW 2113 (D278) Scripting & Programming Foundations Latest OA Guide 2025tions Latest OA Guide 2025

Content preview

D278 ITSW 2113

Scripting & Programming - Foundations

3.0 Credits

Objective Assessment Review (Qns &
Ans)

2025




©2025

, Question 1:
A data analytics professional is optimizing a Python script that processes large
datasets. To identify performance bottlenecks in the code, which module should be
used for profiling?
A. `timeit`
B. `cProfile`
C. `pdb`
D. `logging`

Correct ANS: B. `cProfile`

Rationale:
While the `timeit` module can benchmark small code snippets and `pdb` is a
debugger, `cProfile` is the dedicated profiler in Python that collects comprehensive
performance statistics, making it ideal for identifying bottlenecks within large-scale
data processing scripts.

---

Question 2:
Which of the following is not typically a characteristic of scripting languages
compared to compiled languages?
A. Dynamic typing
B. Interpreted execution at runtime
C. Automatic memory management
D. Requirement for explicit memory allocation

Correct ANS: D. Requirement for explicit memory allocation

Rationale:
Scripting languages like Python and JavaScript are known for their dynamic typing,
interpreted execution, and automatic garbage collection. Unlike many compiled
languages such as C or C++, scripting languages do not require explicit memory
allocation or management.

---

©2025

, Question 3:
In the context of advanced programming, which statement about closures is most
accurate?
A. A closure is a recursive function that calls itself indefinitely.
B. A closure is a function that captures variables from its lexical scope.
C. Closures are used solely for implementing object-oriented concepts.
D. A closure allows a function to modify global state without restrictions.

Correct ANS: B. A closure is a function that captures variables from its lexical
scope.

Rationale:
Closures enable a function to "remember" the environment in which it was created.
This mechanism is central in functional programming and is widely used in scripting
languages to manage state without relying on globals.

---

Question 4:
Which option best describes the concept of duck typing in dynamic programming
languages?
A. Determining an object's type based solely on its class declaration
B. Inferring an object's capabilities based on the presence of certain methods and
properties
C. Relying on compile-time type checks to enforce method signatures
D. Using interface declarations to restrict object behavior

Correct ANS: B. Inferring an object's capabilities based on the presence of
certain methods and properties

Rationale:
Duck typing centers on the principle that “if it quacks like a duck, it must be a duck.”
This means that the suitability of an object is determined by the methods and
properties it supports rather than its explicit type, promoting flexibility in dynamic
languages.

---

Question 5:
When automating file processing tasks, ensuring resource cleanup even when

©2025

Document information

Uploaded on
May 9, 2025
Number of pages
23
Written in
2024/2025
Type
Exam (elaborations)
Contains
Unknown
$18.49

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

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.
EmilioOchieng
4.1
(24)
Sold
148
Followers
17
Items
4032
Last sold
3 months 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