#312 Forward deployed engineer interviews 5.7 min
Air-Gapped Python Install: Offline Wheels and Hashes
A swapped package installed with no error. With hash checking on, it was refused.
Run the offline install demo
Copy the code folder first. Install pip 26.2.2 as the video does (python -m pip install pip==26.2.2, best in a fresh virtual environment), then run python run.py. It needs internet once, to download tabulate, and everything after that runs with the network switched off by settings. Compare your seven lines with the video: the bad copy has a different hash, is refused when hashes are checked, and installs with an extra file when they are not.
A hint
Your first hash characters should match the video if you downloaded the same wheel.
Predict a different missing package
In run.py change colorama==0.4.6 in the missing requirements file to tabulate==0.9.0. This is a prediction exercise. Before you run it, write down what the line starting a package not in the folder will print, then run it. What does this tell you about what the wheelhouse folder decides? Then change tabulate==0.9.0 back to colorama==0.4.6.
A hint
The label of that print line stays the same, but the package changed.
Predict a hash file without the flag
In run.py change the check_hashes=True argument in the refuse install to check_hashes=False. This is a prediction exercise. The requirements file still has a hash on its line. Using what the video says about the pip documentation and one hash, write down whether the bad copy will still be refused, then run it and check. Then change check_hashes back to True.
A hint
The video says one hash switches hash checking on for the whole file.
Predict a different extra file
In wheelhouse.py in the tamper function, change tabulate/_added.py to tabulate/_other.py. This is a prediction exercise. Predict what the two printed lines 'bad copy has the same hash' and 'extra file' will say, then run it. Afterwards change _other.py back to _added.py. Why does the hash still change, even though the check for the extra file now finds nothing?
A hint
The extra file check looks for the name tabulate._added.
These tasks are for you to try on your own machine. Nothing is checked or saved.
What this does not show
A simulated air gap (pip settings and a dead proxy; the proxy is never reached in this run), one small package with no dependencies, one laptop. The download step needs internet. Hash checking shows a file is the one you downloaded, not that it is safe.
Up next in Forward deployed engineer interviews
More in Forward deployed engineer interviews
- #302 Forward Deployed Engineer Interview: What Is Tested
- #303 The FDE Decomposition Round: Vague Ask to a Plan
- #304 Scope an AI Pilot: Metric, Baseline and Stop Rule
- #305 Retry a Flaky API Without Duplicates: Idempotency Keys
- #306 Webhooks Done Right: Signatures, Retries and Replays
- #307 Schema Drift: Map a Customer's Data and Catch Changes
Related videos
- #302 Forward Deployed Engineer Interview: What Is Tested Forward deployed engineer interviews
- #303 The FDE Decomposition Round: Vague Ask to a Plan Forward deployed engineer interviews
- #304 Scope an AI Pilot: Metric, Baseline and Stop Rule Forward deployed engineer interviews
- #305 Retry a Flaky API Without Duplicates: Idempotency Keys Forward deployed engineer interviews
