Scripting interview questions
2 questions interviewers actually ask, each with a model answer you can study and an AI drill that grades how you would say it out loud.
0/2
Mastered
Questions and answers
Model answer
set -e exits on any command failure, set -u errors on use of an unset variable, and set -o pipefail makes a pipeline fail if any stage fails, not just the last. Together they make scripts fail loudly and early instead of silently continuing in a broken state, which is essential for reliable automation.
Model answer
An idempotent operation produces the same result whether run once or many times, for example ensuring a user exists rather than blindly creating it. It matters because automation and configuration management re-run frequently, and idempotency makes re-runs safe, which is the foundation of declarative tooling.