Shell Scripting and Automation Questions

Shell-language craft for operations work: Bash and POSIX sh scripting, pipes and redirection, quoting and word splitting, exit codes and set -euo pipefail (including failures inside pipelines), traps and cleanup, argument parsing with getopts, functions and arrays, parameter expansion, here-documents, and text processing with grep, sed, awk and jq, including streaming pipelines over very large log, CSV and JSON Lines files. Also covers writing robust, idempotent, portable scripts (locking, atomic file updates, retries with backoff, safe temp files, GNU versus BSD differences), background jobs and signals, bounded parallelism and SSH fan-out, cron-driven jobs such as log rotation, backups, atomic deploys and health-check watchdogs, secure scripting (eval injection, secrets, path traversal), and debugging, testing and linting shell with ShellCheck and bats. Boundary: general automation design and Python or Go tooling, Linux host administration tasks, observability and alerting design, security detection engineering, and generic algorithmic coding problems are covered elsewhere.

MediumTechnical
23 practiced

A script with #!/bin/sh works on your laptop but fails inside an Alpine container. What Bash-specific features probably crept in, how do you find them, and how do you decide between rewriting for POSIX sh and just requiring Bash?

HardTechnical
24 practiced

A shell pipeline of awk, sed and jq processes many multi-GB JSON Lines files daily. When is that the right tool, when would you replace it with a small program in another language, and how would you speed up what you keep?

HardTechnical
20 practiced

Build a shell pipeline that encrypts a large directory and uploads it to remote storage without ever writing an unencrypted copy to disk, and that copes with network failures. How do you know the upload is complete and restorable?

EasyTechnical
23 practiced

A teammate puts set -euo pipefail at the top of every script. Explain what each of those three settings changes, and describe the situations where a script would still behave in a way that surprises you.

HardTechnical
22 practiced

A continuous log stream with ISO 8601 timestamps and HTTP statuses arrives on stdin. Using Bash and awk with bounded memory, compute the error rate over a sliding five-minute window.

Unlock Full Question Bank

Get access to all 48 Shell Scripting and Automation interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.