InterviewStack.io LogoInterviewStack.io

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.

MediumTechnical
82 practiced

Write a Python script 'runbook-runner.py' that consumes a YAML runbook of steps like:

  • name: create-db
    run: ./scripts/create_db.sh
    rollback: ./scripts/drop_db.sh

The runner must execute steps sequentially, support '--dry-run', support '--parallel' to run independent steps concurrently (assume the YAML indicates dependencies), and implement rollback behavior which executes rollback commands in reverse order if any step fails. Outline code structure, error handling, and how you would implement dependency-based parallelism and rollback ordering.

EasyTechnical
76 practiced

Describe safe retry strategies for operational automation that interacts with flaky remote services (APIs, package registries, databases). Explain exponential backoff, constant backoff, full jitter vs equal jitter, max-attempt limits, retry windows, idempotency concerns when retrying side-effecting operations, and when to circuit-break instead of retrying. Include examples of mistakes that can cause cascading failures.

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
91 practiced

Discuss the trade-offs between writing custom Python automation tooling and adopting mature tools like Ansible, Terraform, or Helm. Consider maintenance burden, flexibility, onboarding, security and compliance, reuse across teams, and long-term scaling. Provide decision criteria and concrete examples of when building custom Python tooling is justified versus when to rely on existing tools.

EasyTechnical
91 practiced

Explain the main trade-offs between using synchronous subprocess invocation (subprocess.run) and asyncio-based subprocesses (asyncio.create_subprocess_exec) in Python automation. Discuss blocking behavior, ease of implementation, concurrency models, and when you should prefer asyncio for SRE automation tasks.

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.