Katkat

Automate Python Virtual Environment Setup on Linux Terminal

Capital OneData Scientist · Onsite

Last updated

This question evaluates proficiency in shell scripting and Linux terminal automation for Python virtual-environment setup, focusing on environment management, automation, and reproducibility skills relevant to data science workflows.

Scenario

Shell script that automates Python virtual-environment setup on a Linux terminal during a tech interview

Question

Walk through the script line-by-line and explain exactly what each command does. What advantages does writing this logic as a shell script provide compared with other approaches? Run the script in the terminal and describe the expected side-effects or files that should appear.

Hints

Think about shebang, set -e, virtualenv, source, permission bits, idempotency, and automation benefits such as reproducibility.