A senior engineer asks you to write a script that resizes and normalizes images before training. What makes the script easy to review and reuse?
- Exam domain
- Multimodal Data15% of the exam
- Difficulty
- Easy
- In this mock
- 7 questions on this domainPractise this domain
Why the exam asks this
Multimodal Data (15% of the exam)
Objective in the exam guide: Write software components or scripts under the supervision of a senior team member.
Associates write components under supervision.
Why B is the answer
Clear functions, parameters for paths and sizes, and a small test
Small functions, configurable parameters and a quick test make a script readable, reusable and safe to change.
Remember: Write small, parameterized, tested scripts.
How it works
Supervised scripting focuses on readable, configurable and tested code that seniors can review.
In detail
- Parameters instead of hard-coded values.
- Test before handing over.
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. Hard-coded file paths and no commentsWrong
Hard-coded paths break on other machines.
B. Clear functions, parameters for paths and sizes, and a small testRight
Write small, parameterized, tested scripts.
C. One long cell in a notebook with outputs deletedWrongMost tempting
A single cell is hard to review or reuse.
Why it tempts: Notebooks are common in ML work.
D. Copying code from several sources without checking itWrong
Unchecked code can be wrong or unlicensed.
Use case
An illustrative scenario, not a real incident.
Illustrative: the same script later preprocesses a second dataset by changing two arguments.
See it in different ways
flowchart LR S0["Write functions"] --> S1["Add parameters"] --> S2["Add a test"] --> S3["Run on a sample"] --> S4["Request review"]
How to read this chart
- Read it in order: Write functions, then Add parameters, then Add a test, then Run on a sample, then Request review.
mindmap
root(("Script quality"))
n1["Structure"]
n2["Functions"]
n3["Config"]
n4["Arguments"]
n5["Safety"]
n6["Tests"]
n7["Review"]How to read this chart
- The centre is "Script quality".
- "Structure" covers "Functions".
- "Config" covers "Arguments".
- "Safety" covers "Tests", "Review".