Quiz: Software Setup and the Developer Environment on the Raspberry Pi 5¶
Test your understanding of software setup and the developer environment on the Raspberry Pi 5 with these review questions.
1. What is a Python virtual environment?¶
- A single file containing a complete, ready-to-boot copy of an operating system
- A relationship where one piece of installed software requires another specific package to run
- A controlled test that measures a storage device's read or write speed
- An isolated, self-contained copy of the Python interpreter and its installed libraries for a single project, separate from the system-wide installation
Show Answer
The correct answer is D. A Python virtual environment creates an isolated, self-contained copy of the Python interpreter and its installed libraries for a single project, completely separate from the system-wide Python installation and from any other project's virtual environment. Option A describes an operating system image, option B describes a package dependency, and option C describes a storage benchmark.
Concept Tested: Python Virtual Environment
2. What does git commit do?¶
- Permanently records a snapshot of staged changes, along with a message, into the project's history
- Creates a new repository in the current folder
- Stages specific changed files to be included in the next snapshot
- Extends local history to a remote server
Show Answer
The correct answer is A. git commit permanently records a snapshot of staged changes, along with a short message describing what changed, into the project's history. Option B describes git init, option C describes git add, and option D describes pushing to a GitHub repository.
Concept Tested: Git Basics
3. What is cross compilation, and why does it matter for Raspberry Pi OS?¶
- Compiling software on the same type of computer it will run on, to guarantee compatibility
- A process that only applies to Python virtual environments, not operating systems
- Compiling software on one type of computer (a fast desktop) to produce a program that runs on a different type of computer (the Pi's ARM processor), which is why a fresh OS image is ready to download the same day new hardware ships
- Running two operating systems simultaneously on the same Pi board
Show Answer
The correct answer is C. Cross compilation is the process of compiling software on one type of computer, typically a fast desktop with an x86 processor, to produce a program that runs on a different type of computer — the Pi's ARM processor — which is why the heavy lifting of building an OS image happens elsewhere, on hardware built for the job. Option A describes the opposite of cross compilation, option B incorrectly limits it to virtual environments, and option D describes an unrelated concept.
Concept Tested: Cross Compilation
4. What is the key difference between Git version control and a GitHub repository?¶
- Git and GitHub are two names for exactly the same tool
- Git tracks changes locally on your own machine, while a GitHub repository extends that history to a remote server for backup and sharing
- Git tracks history remotely on GitHub's servers only, while GitHub tracks history locally on your own machine
- Git only works with Python projects, while GitHub works with any programming language
Show Answer
The correct answer is B. Git tracks history on your own machine, while a GitHub repository extends that history to a remote server, giving your project a backup that survives even if your Pi's storage fails and a shareable link a teacher or teammate can view. Option A incorrectly treats them as identical, option C reverses their roles, and option D invents a programming-language restriction not in the chapter.
Concept Tested: GitHub Repository
5. Why does the chapter say a heat sink or active cooling fan can still fail to keep a Pi 5 cool inside a sealed case?¶
- A heat sink and active cooling only work correctly outside of any enclosure entirely
- Case and ventilation only matters for microSD storage, not for cooling
- Sealed cases automatically increase a Pi 5's clock speed, causing more heat
- A heat sink or fan can only move heat as far as the inside surface of the case; without vents for air to escape and enter, heat accumulates inside the enclosure until the processor throttles anyway
Show Answer
The correct answer is D. The chapter explains that a heat sink or fan can only move heat as far as the inside surface of a sealed case, and without a way for warm air to escape and cooler air to enter, heat simply accumulates inside the enclosure until the processor throttles anyway, defeating the cooling hardware entirely. Option A overstates the restriction, option B misapplies the concept to storage, and option C invents a cause-and-effect relationship the chapter does not describe.
Concept Tested: Case And Ventilation
6. A student runs these three commands in order: python3 -m venv env, source env/bin/activate, pip install numpy. What is true immediately after all three commands finish?¶
- NumPy is installed system-wide, affecting every Python project on the Pi
- The commands create a GitHub repository named env
- NumPy is installed only inside the isolated 'env' virtual environment, without affecting the system-wide Python installation
- The commands fail because pip cannot be used inside a virtual environment
Show Answer
The correct answer is C. The first command creates a new virtual environment folder, the second activates it so subsequent commands use that isolated environment, and the third installs NumPy specifically into that isolated environment — leaving the system-wide Python installation and any other project's virtual environment completely unaffected. Option A contradicts the entire purpose of a virtual environment, option B confuses this with Git, and option D is false since pip works normally inside an activated virtual environment.
Concept Tested: Python Virtual Environment
7. A student runs: scp pi@raspberrypi.local:/home/pi/projects/data.csv ./ from their laptop's terminal. What does this command do?¶
- Copies data.csv from the Pi's /home/pi/projects/ folder to the current folder on the laptop
- Copies data.csv from the laptop to the Pi's /home/pi/projects/ folder
- Deletes data.csv from the Pi after copying it
- Opens an SSH session into the Pi without transferring any files
Show Answer
The correct answer is A. The chapter explains that scp's argument order determines direction, and reversing the two arguments from the chapter's own example (which copied a local file to the Pi) copies a file from the Pi back to the local machine instead — here, from the Pi's path into the current local folder (./). Option B describes the reversed direction. Option C invents a delete behavior scp does not perform, and option D misdescribes scp as SSH without a file transfer.
Concept Tested: File Transfer Protocol
8. A student wants to write Python code for a headless Pi 5 project using their laptop's comfortable screen and keyboard, while making sure the code actually runs against the Pi's own Python interpreter and has direct access to its camera and GPIO header. Which setup from this chapter best fits this need?¶
- Thonny running locally on the laptop only
- VS Code on the Pi's own desktop with a monitor attached
- Editing files directly with the Nano text editor over a serial cable
- VS Code on the laptop connected to the Pi over SSH using the Remote-SSH extension
Show Answer
The correct answer is D. VS Code on Pi, used in remote mode with the Remote-SSH extension, runs the editor's interface locally on the laptop while every file, terminal, and Python interpreter used is the Pi's own — giving the comfortable local screen and keyboard while code executes with direct access to the Pi's camera, GPIO header, and AI HAT+. Option A never reaches the Pi's hardware at all, option B contradicts the headless requirement, and option C is impractical for regular development work.
Concept Tested: VS Code On Pi
9. A student is working on two Pi 5 projects: Project A needs version 1 of a library, and Project B needs version 2 of the same library. Both are currently installed directly onto the Pi's system-wide Python installation, and one project keeps breaking whenever the other is set up. What does this chapter identify as the correct fix?¶
- Delete Project B's code so Project A's dependency stops conflicting
- Give each project its own Python virtual environment, so each has an isolated copy of the library at the version it needs
- Reinstall Raspberry Pi OS from a fresh operating system image
- Use cross compilation to build both library versions into a single combined package
Show Answer
The correct answer is B. The chapter explicitly describes this exact conflict — two projects needing different versions of the same library on a shared system-wide Python installation — and identifies a Python virtual environment as the fix, since each project gets its own isolated sandbox where installing a library has zero effect on any other project. Option A sacrifices a whole project unnecessarily, option C is a drastic overcorrection, and option D misapplies cross compilation to an unrelated problem.
Concept Tested: Package Dependency
10. A student runs the chapter's dd benchmark on a microSD card and measures 22 MB/s write speed. Their project plan involves continuous real-time video recording, which the chart's threshold line marks as needing at least 80 MB/s sustained writes. Based on this chapter, what should the student conclude?¶
- The microSD card is inadequate for this project's write-speed needs, and a faster option like NVMe storage should be considered
- The microSD card's measured speed is irrelevant, since operating system image size is what actually matters
- The benchmark result only applies to reading data, not the project's video-writing needs
- Case and ventilation improvements would resolve the storage speed shortfall
Show Answer
The correct answer is A. A storage benchmark measures a device's real read or write speed under a repeatable workload so it can be compared directly against another device or against a project's actual needs; a measured 22 MB/s clearly falls short of an 80 MB/s requirement, meaning a faster storage option should be considered. Option B dismisses a directly relevant measurement, option C mischaracterizes the dd command shown, which specifically tests writes, and option D confuses a cooling concern with a storage-speed limitation.
Concept Tested: Storage Benchmark