Automation Scripting for Operations Questions

Writing scripts and tooling to automate operational and delivery tasks: shell and Python scripting, glue automation, toil reduction, and operational efficiency. Covers automating repetitive infrastructure and deployment work and building internal tooling that raises operational leverage. The concern is task-level automation and scripting, distinct from full pipeline or infrastructure-as-code frameworks.

HardTechnical
82 practiced

Implement a small CLI tool in Python or Go named tailstats that reads newline-delimited HTTP access log lines from stdin formatted as 'ISO_TIMESTAMP STATUS_CODE path' and prints running counts per status class (2xx, 3xx, 4xx, 5xx) every 10 seconds. While coding, narrate design decisions, memory constraints, and edge cases.

HardTechnical
70 practiced

Legacy repositories contain many Python scripts invoking subprocesses without timeouts, retries, or proper error checks. Describe how to implement a static analysis tool (using AST) to scan repositories and flag calls to subprocess.Popen/call/run that lack timeout arguments or a try/except wrapper. Provide pseudocode or a small detection rule using Python's ast module and explain how to integrate this check into CI as a blocking lint step.

MediumTechnical
72 practiced

Implement a Python helper 'run_cli(cmd: List[str], timeout: int, log_file: str)' that runs an external CLI safely: it should enforce a timeout, stream stdout and stderr to a rotating log file, return the exit code, and ensure no zombie processes remain if the parent crashes or is killed. Show key code and explain how you guarantee resource cleanup on termination.

EasyTechnical
96 practiced

In Python 3, implement a small CLI skeleton using argparse with subcommands backup and restore. Requirements: global --verbose and --dry-run flags, backup --path PATH must validate that PATH exists, restore --version VERSION must accept a version string. The submission should focus on argument parsing, validation, help text, and exit codes (0 success, 1 runtime error, 2 for usage). You do not need to implement real backup logic, only the CLI structure and validation.

MediumTechnical
77 practiced

Design a robust backup automation workflow for a production database from first principles. What does the schedule and retention story need to look like, how do you actually verify a backup is restorable rather than just assuming it is, and how would you automate periodic test restores and surface backup health to the teams who depend on it? Be explicit about the recovery time objective (RTO) you're designing for and how encryption and off-site replication fit in.

Unlock Full Question Bank

Get access to all 29 Automation Scripting for Operations interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.